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 java naming and directory service?

526


What is wildfly java?

481


What is setfocusable in java?

577


Describe the ear, war, and jar.

524


What is j2ee product provider?

562






I Want build and release interview questions

3127


What is event in java?

474


What is j2ee application model?

478


What is the preferred size of a component in java?

451


What does enterprise javabeans module contain?

523


What is authorization?

588


What is single tier architecture in java?

485


What is awt panel java?

508


What is enterprise information system?

548


What is full form of j2ee?

528