I have a doubt regarding how memory is allocated for instance objects in JAVA. Can you please answer the following questions.
[1] How is memory allocated for methods in a class (both static and non-static)?
[2] Suppose I have an inner class within an enclosing classes, is memory allocated for the inner class too or unless its instantiated?
[3] How come the inner class can access instance variables inside the enclosing class and NOT vice-versa?
Kindly reply in detail.
Thanx a lot in advance.
regards,
Sam.
[1] How is memory allocated for methods in a class (both static and non-static)?
[2] Suppose I have an inner class within an enclosing classes, is memory allocated for the inner class too or unless its instantiated?
[3] How come the inner class can access instance variables inside the enclosing class and NOT vice-versa?
Kindly reply in detail.
Thanx a lot in advance.
regards,
Sam.