can you pl help me out on this problem ..i have spent a lot of time on this question but iam unable to find the answer
What if i want to write a class in such a way that only one instance of it can be created , and anyone who wants to use an instance of the class will always use that one single instance
i know i will have to use static variables and constructors some where and later once the object is created the constructor must turn private..can anyone pl help how should i overcome this problem given above