• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

How many ways to break Singleton in Java?

 
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please can anyone tell me , how many ways to break singleton in Java?

Regards,,
Prabhat
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by 'break singleton' ?
 
Prabhat Ranjan
Ranch Hand
Posts: 397
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i mean singleton is basically used not to create multiple instance of the class.

but is there any way to create multiple instance lets say cloning() or any another..

 
author
Posts: 23867
141
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Prabhat Ranjan wrote:Yes, i mean singleton is basically used not to create multiple instance of the class.

but is there any way to create multiple instance lets say cloning() or any another..



Well, if the singleton is created correctly, then you should not be able to create more than one instance.

If you can, then there is a bug, and depending on the bug, I guess there could be countless ways to break it.

Henry
 
Marshal
Posts: 25135
64
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe what you are missing is this: "singleton" is simply a description, or definition. But you seem to be asking about actual implementations, or attempted implementations, of that definition, without giving any examples of those attempted implementations.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!