What is singleton class?
Answer Posted / vimal eldose george
Singleton gives only one instance.
class Single{
static int objCreated = 0;
private Single(){
}
public static Single getThis(){
if(objCreated==0)
{
return new Single();
ob=1;
}else
{
return this;
}
}
}
Is This Answer Correct ? | 32 Yes | 17 No |
Post New Answer View All Answers
Difference between process and thread?
What is the byte order of byte buffer?
What is integer size in java?
What is a “stateless” protocol ?
Name some OOPS Concepts in Java?
Does string is thread-safe in java?
What about main() method in java ?
Difference between method overloading and overriding.
Is empty .java file name a valid source file name?
Differentiate between overriding and overloading cases?
Why a dead thread occurs?
What does exclamation mean in java?
What does the “final” keyword mean in front of a variable? A method? A class?
What is the structure of java?
Which is dependent variable?