is it possible to create single instance of java class per
session in web application
Answer Posted / ananth
by using Singleton pattern we can achieve one instance per
class.
Public final class Singleton{
private static Singleton singleton;
public static Singleton getInstance()
{
if(singleton ==null)
{
singleton=new Singleton();
}
retuen singleton;
}
public void getvalue()
{
}
}
| Is This Answer Correct ? | 7 Yes | 6 No |
Post New Answer View All Answers
What is event and listener in java?
What is the use of method save()?
What is application client module?
Is java is a technology?
What is the best java application server?
Is c++ more secure than java?
Describe the ear, war, and jar.
What is authorization constraint?
How will you explain load() and get() methods?
What is meant by applet in java?
What is javac written?
Define the struts in the j2ee framework?
What are the main components of the j2ee application?
What is j2ee and j2se?
In DAO we are writting sql queries , how it is possible with creating and closing database connections.