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
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
What is variable and constant explain with example?
What is a string what operation can be performed out with the help of a string?
What is a jit compiler?
What is nextint java?
What is the difference between state-based unit testing and interaction-based unit testing?
What is the private method modifier?
Explain all java features with real time examples
What is a conditional statement explain with example?
Is java programming easy?
How are the elements of a gridbaglayout organized?
Can java program run without jre?
What is the difference between conversation & casting?
What is generics in java interview questions?
Explain implementation and how is it different from conversion?