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 is ioc concept & explain it?
Is there a guarantee of uniqueness for entity beans?
For which statements does it make sense to use a label?
What restrictions are placed on the values of each case of a switch statement?
What is TL and its use?
What are the purpose of introspection?
What is the difference between system.out ,system.err and system.in?
What is the purpose of the notify() method?
Why doesn’t the focus feature on the tag work in every circumstance?
what is Activation Instantinator?
What is the difference between the ‘font’ and ‘fontmetrics’ class?
If your ui seems to freeze periodically, what might be a likely reason?
What is a tasks priority and how is it used in scheduling?
What are the difference between RMI and CORBA?
how to use debug in my elipse to solve problems that exist in my project