What is singleton class?
Answer Posted / nagarjuna
Singletonclass is a class which can be instantiated only once.
public class Singleton
{
private static single = new Singleton();
Private Singleton();
{}
}
For a singleton class, the constructor is made private and
a static variable is used for instatiating the class.
Is This Answer Correct ? | 4 Yes | 6 No |
Post New Answer View All Answers
What is the difference between multitasking and multithreading in Java
Is null a string or object in java?
How do you make an arraylist empty in java?
Is main is a keyword?
What is procedure writing?
Can you have two constructors in java?
Implement a stack with push (), pop() and min() in O(1) time.
Write a program to check string is palindrome without using loop?
What is increment in java?
What are the two basic ways in which classes that can be run as threads may be defined?
How many types of constructors are used in java?
What are multiple inheritances? Is it supported by java?
What is one third plus one third as a fraction?
What is the symbol for line break?
What exactly is java?