- JDK is intend to developer as it contain development tools such as compiler, javadoc, java debugger etc.
- Virtual Machine is software implementation of machine.
- Java is designed to run on virtual machine.
- Self Contained simulation of physical machine.
- Single program execution VM or System VM for execution of OS.
- Process : Instruction Fetch, Decoding, execution and storing result.
Features of JVM :
- Stack Based : Because push and pop operation. (Content Link)
- Operands addressed implicitly,Stack Pointer,Push/Pop Operation
- Register Based
- Instruction need to have address of operands
- Advantage : Fast Execution & Optimization (result future use)
- Disadvantage: Average Instruction size is more than Stack
- Symbolic Reference:
- All Types referred through run time constant pool
- All primitive type referred through explicitly memory address based.
- Garbage Collection: Class instance created by used, destroyed by automatic GB.
- Guarantee Platform Independence (int size in c/C++ platform to platform)
- Network byte order
- Java Source File converted to Byte Code by java compiler.
- Class Loader: It loads the byte code to run time data access and then provide to execution environment for execution
- Dynamic Load Feature: Load and link every class first time at run time but not at compile time. JVM class loader execute this.
Class Loader Feature:
- Hierarchical Structure (Bootstrap Class Loader is Parent of all)
- Delegation Mode: Checked Parent for loading, if not then requesting loader will load
- Visibility Limit: Only child can see class loaded by parent.
- Unload is not allowed: Only new creation is allowed (if want create new loader)
FQCN (Fully Classified Class Name) Store Identifier for every class of classloader.
Process of loading & linking a class by class loader :
- Byte code assigned to run time data areas via loaded executed by this engine.
- Execute one by one instruction.
- Byte code is human readable so it will be converted to machine specific code.
- Conversion to machine code done in following ways.
- Interpreter : Read, Interpret and execute one by one. But slowly execute interpreted language.
- Just In Time Compiler (JIT): This run interpreter first then at appropriate time JIT compile entire byte code to native code.