Note: When we create a new object by using new keyword, then implicitly default constructor run and set the height width 10, 20 for new Object, if we pass parameter as 10 and 20. Default constructor run when we want to initialize the common data for every object. eg when we buy a new mobile sim, then for every new sim they give some amount initially and only for once.
When we create an object, then identity of this object create in memory in heap area and as a identity created instance variable(non static data) get memory allocated in heap area and generated reference id ,and it goes into t1 reference variable and reference variables are the implicit pointer which points the newly created current object and stored .and method and constructor get memory in method table which is inside memory area, and local variable get memory allocated In stack Area.
Sol: Because for memory management.
When you use object.getDimension(); then you are mapping heap to stack.
Method get memory in method table which is inside memory area but when you call the method then it comes inside stack means calling of method is happening from stack. Task will created for main method and another method will be separate.
Note: When we call any method, then it depends on the object that which method it will call or on which reference id that method is called then it will refer to only that memory.
Rule: Reference of an object can be hold into n number of reference variable.
Garbage collector only free unreference object .