java - what exactly happens when new operator is called for array and object? -
i may wrong understand when creating object in java by:
class object = new class; the new class create new object of class type applied "object" reference
so when u create array of objects by:
class[] objects = new class[10]; does mean new class[10] creates 10 objects of class type wich applied objects reference or memory size of 10 objects of class type reserved , need create objects later
later correct new class[10] create placeholder 10 objects in memory , need put objects explicitly in them.
Comments
Post a Comment