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
cud u help me ... i am struggling with this question... to find all the subsets of a given set for ex.... a,,b,c shud give all the subsets.... i gt the program in c bt nt able to get it in java..... help needed ..
What is a class loader?
whats is mean by connectionpooling
What happens when a thread cannot acquire a lock on an object?
Explain the advantages and disadvantages of detached objects.
Why is string immutable in java?
What is bean? Where can it be used?
what are the activation groupworks?
which type of objects reference will be given to client?
what is meant by JRMP?
What is meant by method chaining?
What are the purpose of introspection?
How will you pass parameters in RMI? Why do you serialize?
What is a tasks priority and how is it used in scheduling?
When a thread blocks on i/o?