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
Do you think that java should have had pointers?
Define prototype?
What is a sessionfactory? Is it a thread-safe object?
Is jvm a overhead?
Can I run seam outside of jboss as?
how i secure my site with the https protocol.what are the steps?
What are the benefits of detached objects?
we use MainFrame and using os390 for operating system with DB2 data base in IRAN and interest programing with java and use webspere for world wide,please help me where i should start?
What is a policy?
Difference between new operator and class.forname().newinstance()?
What is the difference between the ‘font’ and ‘fontmetrics’ class?
Name the class that is used to bind the server object with RMI Registry?
What modifiers may be used with an inner class that is a member of an outer class?
What do you need to set-up a cluster with jboss?
What are local interfaces? Describe.