Q- Create a program that has only 10 object at any time ?
posted 4 years ago
That's an entirely meaningless question. A JVM that starts up will have allocated thousands of objects before ever executing your code. And if your code allocates just one class library object, that most likely allocates more objects in turn. In other words: you won't know how many objects your code causes to be allocated.