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...


What is the singleton class in java?

Answers were Sorted based on User's Feedback



What is the singleton class in java?..

Answer / leelanarasimhareddy

A singleton is a class for which only one instance can exist
within a program. In other words, only one, single object of
that particular class can be created in a program.

Is This Answer Correct ?    7 Yes 0 No

What is the singleton class in java?..

Answer / naman patidar

A singleton class can never have more then one instance.
Example :

class SingletonClass {
private static SingletonClass singleObject;

public static SingletonClass getInstance() {
if (singleObject == null) {
singleObject = new SingletonClass();
}
return singleObject;
}
}

Is This Answer Correct ?    3 Yes 2 No

What is the singleton class in java?..

Answer / paletipatisrinu

singleton class:A java class create only one object per jvm
is called singleton java class.Most of jdbc driver class
implemented as a singleton java class

Ex:
class SingletonClass
{
private static SingletonClass singleObject;
public static SingletonClass getInstance()
{
if (singleObject == null)
{
singleObject = new SingletonClass();
}
return singleObject;
}
}

Singletone java class example is
org.apache.struts.action.ActionServlet

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Java Related AllOther Interview Questions

i heard that JVM internally contains pointers...is this true?

4 Answers   Wipro,


Which interceptor is responsible for setting action javabean properties?

0 Answers  


what are the different phases in delivering the project during development and maintenance?

0 Answers   CTS,


Can optional be null?

0 Answers  


Define network programming?

0 Answers  


What do you understand by casting in java language? What are the types of casting?

0 Answers  


What is java api?

0 Answers  


What is ehcache in java?

0 Answers  


What is the meaning of the words public, static and void?

0 Answers  


what diff bw constructor method & method

4 Answers   CTS,


Explain different way of using thread?

0 Answers  


What is tight coupling in java?

0 Answers  


Categories