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 difference between calling start() and run() method of thread?
Is java a digit method?
What is the point of java?
Difference between operator overloading and function overloading
What is arraylist e?
What is logical variable?
How would you format a date in java? I.e. In the ddmmyyy format?
What happens if we override only equals?
What do you mean by stream pipelining in java 8?
How do you compare characters in java?
Is hashmap thread safe?
What technique is carried out to find out if a particular string is empty?
Why scanner is used in java?
How to perform selection sort in java?
Is set ordered in java?