+ 3

In which area of JVM the static block is execute in java?

In java when we call a method then there is stack frame push on java stack to execute that method block. Now when we write a static block which is execute before main method, there is no stack frame is push on java stack. Then in which area of JVM the static block is executed?

8th May 2018, 4:23 PM
Vijay Dangi
Vijay Dangi - avatar
1 Respuesta
+ 1
At class Area static block is execute when class is load. when class is load. all static data member take space in a memory called "Class area". and all member function static or instance.. take space in memory called 'Method Area" and object store at heap.
13th May 2018, 9:43 PM
Arun Tomar
Arun Tomar - avatar