Senin, 26 Desember 2011

Java Programming


Java Language

Like any other programming language, java language has its own pattern, syntax rules, and programming paradigm. The java language's programming paradigm is based on the concept of object-oriented programming (OOP), that's java's features support it.

The java language is a C-language derivative, so its syntax rules seems like C's language syntax rules. For example, code blocks are modularized into methods and delimited by brace ({ and }), and variable are declared first before we use them.

Structurally, the java language starts with packages, a package is the java language's namespace mechanism. Within packages are classes, and within classes are method, variables, contants, and so on.


About Java Compiler

When we program in java platform, we write the code in .java files extension and then compile them. The compiler checks our code againts the language syntax rules, then writes bytecodes in .class file extension. Bytecode are standard instructions targeted to run on a Java Virtual Machine (JVM). In adding this level of abstraction, the java compiler differs from other language compilers, which write instructions that suitable for the CPU chipset the program will run on.

The Java Virtual Machine

At run time, the JVM reads and interprets .class files extension and execute the programs instructions on the native hardware platform for which the JVM has written. The JVM interprets the bytecodes just as a CPU would interpret assembly-language instructions. The difference is that the JVM is a piece of software written specifically for an unique platform. The JVM is the heart of the java language priciple, write-once, run-anywhere. Our code can run on any chipset for which a suitable JVM implementation is avaliable. JVM are available for major platform like Linux and Windows, and subsets of the java language have been implemented in JVMs for mobile phones and hobbyist chips.

The Java Runtime Environment

The Java Runtime Environment (JRE, also known as Java Runtime) include the JVM, code libraries and components that are essential for running programs written in the java language. It is available for multiple platform. We can freely redistribute the JRE with our applications, according to the terms of the JRE license, to give the application's users a platform on which to run our software. The JRE is included in the JDK.

The Java Development Kit

When we download a Java Development Kit (JDK), we get- in addition to the compiler and other tools- a complete class library of prebuilt utilities that help us to accomplish just about any task common to application development.

Source: ibm.com

Tidak ada komentar:

Posting Komentar