memory management - Java, what is the cost if I pass a heavy object as argument to some function -
suppose have object classroom, in classroom there many student object (50 objects) more 20 properties, many teacher object (10 objects) more 20. classroom has other properties classno, seatcapacity, etc.
is pass object of classroom object argument method. suppose need 3-4 properties of classroom , 1-2 properties of each students. if bad cost passing heavy object.
in java passing a reference object. , there's no cost difference when pass string
instance or complex class instance, classroom
class.
Comments
Post a Comment