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

How many types of modules is defined by j2ee specification?

482


What is component-managed sign-on ?

534


Describe the ear, war, and jar.

524


What is multi tier architecture in j2ee?

462


Where can I find java developers?

514






What is caller?

535


Define hashtable in j2ee?

550


Is java ee and j2ee same?

497


Which is latest technology in java?

484


What is the difference between java and core java?

485


I Want build and release interview questions

3127


Explain the four types of container that the j2ee specification defines

487


What is authorization?

588


What is devops in java?

526


What is application assembler?

522