Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

Core Java

 
SharajIndia Anand
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
Identify the problem within this snippet of Java/C# code. (This is not a trick question � there is a potential real problem in using this code)

class Singleton
{
public static Singleton Instance() {
if (_instance == null)
_instance = new Singleton();
return _instance;
}
protected Singleton() {}
private static Singleton _instance = null;
}
 
shank ram
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
i think we have had this before ...this is bound to be moved shortly ... check the appropriate forum to post properly.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Report post to moderator
Is this an "excercise for the student" or do you need links to how to fix this potential multithreading problem?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
This is duplicate thread. Please ignore it, I'll ask for it to be closed.
 
    Bookmark Topic Watch Topic
  • New Topic