Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write a program that has only 10 object at any time ?

 
ManojKumar Kumar
Greenhorn
Posts: 2
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q- Create a program that has only 10 object at any time ?
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic