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 ArrayList and Vector? which one is better in Java
What is module in oop?
What are the data types supported by java?
What is downcasting?
What are untrusted applets?
Can we assign the reference to this variable?
What is the difference between object oriented programming language and object based programming language?
Does list maintain insertion order java?
Can we override constructor?
Write a program to print fibonacci series up to count 10.
What are some examples of variable costs?
What is difference between stringbuffer and string?
What is use of arraylist in java?
What is a ?
Why stringbuilder is not thread safe?