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 difference between object oriented programming language and object based programming language?
What is the purpose of a transient variable?
What is the java project architecture?
What is final keyword in java? Give an example.
Explain about complier design(phases)
How can we break singleton in java?
What is private static in java?
What is difference between Heap and Stack Memory?
How do you sort arraylist in descending order?
How do you replace all in word?
How can you traverse a linked list in java?
What is Enum in Java?
How to call one constructor from the other constructor ?
What is the meaning of 3 dots in java?
Does treeset use compareto?