Answer Posted / naman patidar
A singleton class can never have more then one instance.
Example :
class SingletonClass {
private static SingletonClass singleObject;
public static SingletonClass getInstance() {
if (singleObject == null) {
singleObject = new SingletonClass();
}
return singleObject;
}
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Explain the common use of ejb?
If you’re overriding the method equals() of an object, which other method you might also consider?
Explain suspend() method under thread class>
What is a pojo class in java?
What is the java virtual machine (jvm)?
What is ibatis in java?
What is map and flatmap?
Why are command line arguments passed as a string?
What is meant by java se?
What is gwt in java?
What is java web application?
ioc vs dependency injection?
What is lazy loading in jpa?
What is cmp in java?
What is entitymanager in java?