Core Concept of java object
Where java object is created ?
----------------------------------------------------
In Java, all objects are dynamically allocated on Heap.In Java, when we only declare a variable of a class type, only a reference is created (memory is not allocated for the object). To allocate memory to an object, we must use new(). So the object is always allocated memory on heap .
----------------------------------------------------
In Java, all objects are dynamically allocated on Heap.In Java, when we only declare a variable of a class type, only a reference is created (memory is not allocated for the object). To allocate memory to an object, we must use new(). So the object is always allocated memory on heap .
Comments
Post a Comment