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 contextpath in java?
How long can a lambda function run?
What is javabeans api?
What is a context in java?
What is an action class in java?
What is a singleton in java?
How can I swap two variables without using a third variable?
In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.
What is jpa project?
How do I run a java program from the command line?
Why struts framework is used in java?
How do I install java on windows?
How common are security breaches? : java security
Can a dead thread be started again?
When a thread is created and started, what is its initial state?