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 use of jtable?
What is pojo class in java?
What is string and its types?
Where is core java used?
Write an algorithm program in java for the following question.. In a VLSI design techniques,they used rectangles to design circuits. EVery rectangle is to be placed according to x,y coordinates. Check whether or not two rectangles overlap each other. Here overlapping of rectangles is acceptable, if 1) one rectangle intersect with other. 2) one rectangle fully covers other. The time of algorithm should not exceed o(n logn).
What modifiers may be used with a top-level class?
When will we use them?
What does this () mean in java?
What is matcher in java?
What is use of map in java?
What is the difference between integer parseint and integer valueof?
Explain a few methods of overloading best practices in java?
What is the Difference between Final Class && Abstract Class?
What is the method overriding?
What is instance synchronization?