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 singleton class? where it mainly used in the
projects?

Answer Posted / jhuma

singleton class is such kind of class in which only one
object is created throughout the life time of the class.

class Singleton
{
public static Singletone si;
private Singletone()
{
si=new Singletone();
}
public static Singletone show()
{
return si;
}
public static void main(String ar[])
{
Singleton s1=Singletone.show();
}
}

Is This Answer Correct ?    44 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How substring() method of string class create memory leaks?

1044


AS a developer will u create a data source in connection pool? If so how will u do that, how to access the object from connection pool using IRAD tool?

2145


What is the difference between session and entity beans?

1115


What is the difference between the string and stringbuffer classes?

1101


Name the eight primitive java types.

1125


Have you used threads in Servelet?

2508


How a component can be placed on Windows?

2855


How to implement RMI in Java?

2870


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

2099


What is the argument type of a programs main() method?

1115


What are the different approaches to represent an inheritance hierarchy?

1073


Difference between new operator and class.forname().newinstance()?

1133


Is a class a subclass of itself?

1217


What is ioc concept?

1203


What do you mean by Socket Programming?

1084