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 / suresh jv

Singleton class is a class, it allows jvm to create only one
object.
note:
most of the people think that servlet is a singleton class.
but it is not a singleton class. Actually for each servlet
one object will be created by container.
But suppose if u want to create another object for same
servlet, that servlet allows us to create another object but
the container (server) will not allow to create second object.

When a huge amount of requests coming to servlet, some of
the servers (espcially weblogic)allows to create second
object for same servlet to handle huge amount of requests,
then how can u say servlet is a singleton class.
"The class, itself doesn't allow to create second object "
is called singleton class.

this helps a lot u.....

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the diffrence between a local-tx-datasource and a xa-datasource?

1005


For which statements does it make sense to use a label?

1027


which book is better for jdbc ,servlets and jsp

2052


Is there a guarantee of uniqueness for entity beans?

965


what is a portable component?

1943


What’s jboss cache in short?

1065


Which textcomponent method is used to set a textcomponent to the read-only state?

1077


Which class is the immediate superclass of the menucomponent class?

1160


how to make a index.jsp for running the site in internet and find an error for connection with weblogic server and java that give an error invalid object name.and how to maintain session.

2207


What is the RMI and Socket?

1017


What are the steps to write p-to-p model application?

2439


whats is statement and procedure

2144


Why a component architecture for the java platform?

1132


Which characters may be used as the second character of an identifier, but not as the first character of an identifier?

1004


How a component can be placed on Windows?

2793