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 the difference between long.class and long.type?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
which type of objects reference will be given to client?
What is the difference between a menuitem and a checkboxmenuitem?
What is the difference between the ‘font’ and ‘fontmetrics’ class?
What is meant by method chaining?
Name the class that is used to bind the server object with RMI Registry?
What is scalable, portability in the view of J2EE?
Do I need to import javlang package any time? Why ?
How are the elements of a cardlayout organized?
When a thread blocks on i/o?
Where can I ask questions and make suggestions about seam?
what are the advantages of JTA over JTS?
what is the use of State Factories?
How database connectivity in XML is achieved?