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
What is the symbol for average?
Is hashset ordered?
What is the use of join method?
Why is stringbuffer not immutable?
Which methods cannot be overridden in java?
Which is best ide for java?
What are the restrictions imposed on method overriding?
what are the methods in object?
What is var keyword ?
How will you get the platform dependent values like line separator, path separator, etc., ?
What is the difference between synchronized and synchronized block?
What was java originally called?
What does java ide mean?
What is the difference between preparedstatement and statement in java?
What is constant in programming?