I am confused regarding whether memory allocation in java occurs at run time or compile time.
For example:
class Test{ int a; public Test(){
In java a class is not loaded until unless its object is created which are created at runtime so any member variables like "a" in yours will get space when class is loaded same goes for object it will be allocated space at run time.