Wednesday, November 25, 2015

Java

What is Java?

Java is an Object Oriented Programming Language. It is used to develop different type of Software Applications. 

It is structured and platform independent language.
Java is both compiler and interpreter language

Write once/Read anywhere – code that can be run on variety of CPU under different environment.
The Java compiler (javac) will compile the java source file (.java file) to Universal byte code (.class file).  It is a native, which is portable and can be easily executed on all operating systems. Bytes codes usually will be in hexadecimal format and this will be same on every platform. So these bytes code can be transferred from one machine to another (Java is Portable).

The JVM – the interpreter translate this byte codes to machine code and execute the machine language instructions. The machine language is OS dependent.

Java Source Code (.Java file)  à Java Compiler (javac/JIT) Translate à Universal byte codes ( .Class file) à JVM(java)à decodes byte codes to machine language code. And load and execute individual program.

C & C++ are not platform independent:  it requires a full compiler target for that CPU it is expensive and time consuming.

No comments:

Post a Comment