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
Is infobus easy to use?
Do I have to use jsps with my application?
Can we sent objects using Sockets?
Name three subclasses of the component class?
What is the purpose of the wait() method?
Define the remote object implementation?
What are the benefits of detached objects?
What is table mutation and how do you avoid it?
Describe, in general, how java's garbage collector works?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
What is the difference between static and non-static with examples?
Explain how will the struts know which action class to call when you submit a form?
difference between ejb,struts,hibernate,spring and jsp
What is metaspace?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?