What is singleton class?
Answer Posted / ashish srivastava
public class Singleton {
private static Singleton s = new Singleton();
private Singleton(){
}
public static Singleton getObject(){
return s;
}
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is empty string literal in java?
What are the restriction imposed on a static method or a static block of code?
What's the purpose of using break in each case of switch statement?
How many types of equations are there?
What are the 6 mandatory procedures for iso 9001?
What is Mutex (Mutual Exclusion Object) ?
Give example to differentiate between call by value and call by reference.
What is lambda in java?
What are the types of java languages?
What is the purpose of declaring a variable as final?
When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?
List implementations of list interface?
Is alive and join method in java?
Explain 5 features introduced in jdk 1.7?
What are the differences between wait() and sleep()?