In java, When we call a new Constructor(), then a new object is created each time i.e; a new memory is allocated or suppose there are already many objects created for a class that do not have any reference.
So can java return such object that are marked for de-allocation or will the java create a new object each time a new constructor() is called.
What’s my basic intention to ask this question is if such thing happens then performance can be improved as the cost to create a new memory and destroying a un-refrenced object will be reduced.
Yes.
Java will never re-use an object.