Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How many objects are created for a singleton class

Answers were Sorted based on User's Feedback



How many objects are created for a singleton class..

Answer / pushpa

one

Is This Answer Correct ?    10 Yes 1 No

How many objects are created for a singleton class..

Answer / rajani nagandla

The Singleton is a useful Design Pattern for allowing only
one instance of your class.The Singleton's purpose is to
control object creation, limiting the number to one but
allowing the flexibility to create more objects if the
situation changes. Since there is only one Singleton
instance, any instance fields of a Singleton will occur
only once per class, just like static fields.



Is This Answer Correct ?    7 Yes 1 No

How many objects are created for a singleton class..

Answer / sivadasan

Singleton class allows to create only one instance of the
class. But the other objects can inherit from it. Singleton
is a Design Pattern to restrict create more than one
instance of a class.

And

1. It ensures only one object created for a class
2. Provides global point of access.

Mostly it is used to create DB connections.

Is This Answer Correct ?    4 Yes 1 No

How many objects are created for a singleton class..

Answer / utkarsh verma

Some correction required in last solution

void main(){

Single *ptr = Single::Instance(); //The only way to
//instantiate

}

Is This Answer Correct ?    3 Yes 0 No

How many objects are created for a singleton class..

Answer / chaman

Is a design pattern that is used to restrict instantiation
of a class to one object.

Is This Answer Correct ?    3 Yes 1 No

How many objects are created for a singleton class..

Answer / suresh solomon

in clustered environment singletons will have as many instances as JVMs

Is This Answer Correct ?    4 Yes 2 No

How many objects are created for a singleton class..

Answer / utkarsh verma

c++ program to explain Singleton

class Single {

private:
Single(){} //Can't instantiate

public:
Static Single* Obj;
Static *Single Instance ()
{
if(Obj == NULL)
Obj = new Single();
return Obj;
}
}//End of class

Single * Single ::Obj = NULL;

void main(){

Single *ptr = Obj->Instance(); //The only way to instantiate

}

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Core Java Interview Questions

Tell me a few examples of final classes defined in Java API?

0 Answers   DELL,


Do I need java for windows 10?

0 Answers  


Explain tree set and its features?

0 Answers  


What is actual difference between statement,prepared statement and callable statement and when we have to use it? pls post a answer with code and clear explanation. thanks

2 Answers  


What does 3 dots mean in java?

0 Answers  


What are the similarities between an array and an ArrayList?

3 Answers  


how we can make a write-only class in java?

0 Answers  


What are annotations in java?

0 Answers   Impetus,


What do you mean by a JVM?

0 Answers   GE,


Which is faster call by value or call by reference?

0 Answers  


There are three interfaces A,B & C. A extends B, B extends C, and C extends A.Is it multiple Inheritance? please anybody help me.....

5 Answers  


Which is better arraylist or vector?

0 Answers  


Categories