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

Explain ioc concept?

1138


What are transaction attributes?

1105


How to deploy Jar, War files in J2EE?

2687


Where we can write Rmi registry in the code, without having to write it at the command prompt?

2766


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

1075


What are the benefits of detached objects?

1047


What is ioc concept?

1199


What is Stream Tokenizer?

2231


Define the remote object implementation?

2500


How a component can be placed on Windows?

2852


What is a class loader? What are the different class loaders used by jvm?

1103


How will you pass parameters in RMI? Why do you serialize?

1229


Is the infobus client side only?

1107


Explain the difference between object state and behavior?

1043


Can I use multiple html form elements with the same name?

1048