• Post Reply Bookmark Topic Watch Topic
  • New Topic

instance creation using class.newInstance()  RSS feed

 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to control number of instance creation(maximum 10 instance) using class.newInstance(). Any input?
 
Jim Hoglund
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds perfect. Make your constructor(s) private
and set up an array to keep track of the instances
in play, and to clean them up later, if necessary.
Jim ... ...
 
kri shan
Ranch Hand
Posts: 1489
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any other input?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66307
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kri shan wrote:Any other input?
Yes. Saying "thank you" to Jim for his answer would be nice.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!