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
What are the different methods of identifying an object?
How are the elements of a cardlayout organized?
What is permgen or permanent generation?
What are the difference between RMI and CORBA?
Explain ioc concept?
What is a sessionfactory? Is it a thread-safe object?
Will the general public have access to the infobus apis?
What is a clone?
What is the difference between session and entity beans?
Can I run seam outside of jboss as?
what are the advantages of JTA over JTS?
What is bean? Where can it be used?
What are the sequence of steps to write pub or sub model kind of application?
What is the difference between system.out ,system.err and system.in?
what is a non-repeatable read?