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
Explain the importance of finalize() method.
What is finalize()? Is finalize() similar to a destructor?
Who found java?
What is the statements?
What is the epoch date?
What is http client in java?
Which programming language is most secure?
Why do we need wrapper classes?
Can memory leak in java?
What are static initalizers in java ?
What is jar?
Is java util list serializable?
Can a constructor have different name than a class name in java?
What are the six ways to use this keyword?
Can I uninstall java?