Answer Posted / paletipatisrinu
singleton class:A java class create only one object per jvm
is called singleton java class.Most of jdbc driver class
implemented as a singleton java class
Ex:
class SingletonClass
{
private static SingletonClass singleObject;
public static SingletonClass getInstance()
{
if (singleObject == null)
{
singleObject = new SingletonClass();
}
return singleObject;
}
}
Singletone java class example is
org.apache.struts.action.ActionServlet
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is jpa used for?
there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.
What gives java it’s “write once and run anywhere” nature?
What is cmp in java?
Is jpa a framework?
What is meant by annotation in java?
What services can invoke lambda?
What are the types of cookies in java?
How do I enable java in google chrome?
can a program use more than one command-line argument?
Which class is the superclass of every class?
What is the use of entity class in java?
What is rxjava2?
How do you find lambda?
What about 'hostile applets'? : java security