javascript
Brief description  about Online courses   join in Online courses
View Rigin  V 's Profile

single instance of java class

is it possible to create single instance of java class per session in web application
Asked by Rigin V | Jun 7, 2010 |  Reply now
Replies (2)
View Java Teacher 's Profile
yes we can do this..............

by using Singleton pattern we can achieve one instance per
class.
Dec 28, 2010
View sunil kumar mondal 's Profile
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()
{

}

}
Jun 7, 2010