PLS PLS PLS PLS solve this


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: PLS PLS PLS PLS solve this

  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, 12:12 PM

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center