Sunday, 29 July 2012

Java Features

Java has two parts...
1. Core language-
    JVM takes care of running the core language.

2. Standard libraries-
    Large collection of standard library classes that comes with language to        perform some basic tasks. (this is one of the primary reason for java language to be more productive).

What is JVM?
When we write a java program it is known as the source code of java. The java compiler does not compile this source code for any underlying hardware system; rather it compiles it for a software system known as JVM (This compiled code is known as byte code). We have different JVMs for different systems (such as JVM for Windows, JVM for Linux etc). When we run our program the JVM interprets (translates) the compiled program into the language understood by the underlying system. So we write our code once and the JVM runs it everywhere according to the underlying system.
JVM is composed of 
1)class loader & 
2)execution engine.

here, class loader loads class files both from our source code and java api.
(only those api are loaded that are actually needed by our program)
Bytecodes are then executed in execution engine and are compiled to native machine code.

What is Java Runtime Enviroment(JRE)?
The JVM is a part of a large system i.e. JRE.
Each OS and CPU architecture requires different JRE. Along with JVM, it consists of built-in classes.
Without JRE for a given enviroment, it is impossible to run any java S/W.

No comments:

Post a Comment