DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    1

    PLS PLS PLS PLS solve this

    Identify the problem within this snippet of Java/C# code implementing Singleton Design Pattern. (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;
    }

  2. #2
    Join Date
    Apr 2008
    Location
    Finland
    Posts
    52
    What kind of a problem?

  3. #3
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    Because it is protected a class that extends from it can create instances of Singleton?

Similar Threads

  1. solve for me pls
    By hareeshrayala in forum ASP.NET
    Replies: 1
    Last Post: 11-24-2000, 11:12 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links