Hello, tell me please. There are several Heap, Stack & Permanent Generation memory areas in Java. Here we start with the main method. We call him some methods. They have local variables and references that are stored on the stack. All is well. But let's say we create a new instance of the class inside the method. MyClass obj = new MyClass(); But this class has its own methods, variables (class members) of a primitive type. Let's say
class MyClass { int x ; float y; MyClass inObj; } And there are also references to other objects (in this case, an object of the same class). Actually a question. Where local variables and references of the class selected from main will be stored. In Heap or Stack? Thank .