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
How many types of constructors are there in java?
Is java important for my computer?
How do I become a java developer?
What are the main components of a class in java?
What is application assembler?
Is java still slow?
What are different modules in spring?
What is external subset?
What is single tier architecture in java?
What is j2ee specification?
What is connector?
What is ear file?
Is core java and j2se same?
What is jbutton in java?
What is repaint in java?