Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassLoader is Singleton ?

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java API, which class is singleton Class ? ClassLoader is Singleton ?

Thanks.
 
Paul Clapham
Sheriff
Posts: 21126
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward Chen wrote:In Java API, which class is singleton Class ? ClassLoader is Singleton ?


Nope. Check the API documentation and you'll see it has constructors. A class which is meant to be a singleton can only have private constructors -- you can see why that is, right?
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:
Nope. Check the API documentation and you'll see it has constructors. A class which is meant to be a singleton can only have private constructors -- you can see why that is, right?


yes, right. then in Java API, which class is singleton Class ? None ?
 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward:

There are thousands of classes just in the regular Java API. I think you'll have to do that search yourself.

John.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49391
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try Runtime. That might be a singleton.



But why does anybody need to know?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic