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 are the components of J2EE application?

741


Which java technology is in demand?

686


What is general entity?

704


How will you explain cdata?

773


What will happen when you compile and run the following code?

746


Is java gui dead?

678


Is java more difficult than c++?

674


Is java procedural or object oriented?

661


Describe orm?

729


What are the main components of multi-tier architecture?

706


How does event listener work in java?

678


What does resource adapt module contain?

733


What is java naming and directory service?

727


What is the best java compiler?

661


What is DDP?

711