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
What is javabeans api?
What is custom tag in java?
What is crud operations in java?
what is reflection api? How are they implemented?
What do you understand by downcasting?
Is lambda cheaper than ec2?
What is a jpa repository?
Is java built on c?
Describe the principles of oops.
What are the benefits of a jar file?
Can we use lambda without functional interface?
Topic- looping,function overloading,nesting ,polymorphism. Aim - to write a function with a name buzz-buds,that will check whether the given numbers are buddies or not on the basis of no. of parameters passed during function calling.
How do I open the java control panel?
Explain issues of old java date api?
What is the point of lambda expressions?