1. when we execute the java file, JVM is loaded into memory.
2. In JVM, first class loader starts which loads the class into memory, i.e. it divides the code intoRuntime Memory Area.
3. Runtime memory consists of:-
- a) Heap- All the objects in the program are stored in a heap.
- b) Stack- all the local and ref variables are in the stack.
- c) Method area- it is a permanent area. It consists of static variables, class definitions and fxns.
- d) Native code area- the code which is not a part of Java but is a part of the platform, ie., the operating system that's called native code
- e) Program counter register- holds the address of next instruction going to be executed.
4. After the class loader, execution engine (JIT) runs which translate bytecode to machine-operable code.