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


Please Help Members By Posting Answers For Below Questions

What is 'applet container' ?

808


What is java used for in technology?

718


What is element?

745


How do I become a java developer?

722


What is comment?

730


Is tomcat a java ee?

683


What are the types of j2ee clients?

723


What is application configuration resource file?

718


What are the modules of j2ee?

726


Is java still slow?

725


What are defined as web components?

719


What is the container?

764


What is group?

790


Why is j2ee needed?

688


What is j2ee component?

740