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
Name the class that is used to bind the server object with RMI Registry?
what is meant by JRMP?
What are the diff types of exception?
How are the elements of a cardlayout organized?
wahts is mean by dynavalidatorform in struts/
How will you pass parameters in RMI? Why do you serialize?
What are the difference between RMI and CORBA?
Which containers use a border layout as their default layout?
What is clustering? What are the different algorithms used for clustering?
What is a class loader? What are the different class loaders used by jvm?
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
What is the difference between java class and bean?
What is mdb and what is the special feature of that?
Difference between hashmap and hashtable?
Where can I ask questions and make suggestions about seam?