Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to implement singletun design patteren in struts?

Answer Posted / shaik baji

Singletun design patteren means we can't create more than
one object for that class which follws Singletun design
pattern.

We can implement it by using one "private" constructor and
one Factory mathod as like follows:

class Sample
{
public static Sample s = new Sample();

private Sample()//constructor
{

}
public static Sample getInstance()//static factory
method
{
return s;
}
}

public class SingleTun
{
public static void main(String arg[])
{
Sample s1= Sample.getInstance();
Sample s2= Sample.getInstance();

}

}

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why was reload removed from struts (since 1.1)?

1023


What is the design role played by struts?

1054


What are the core classes of the struts framework?

988


how to get the last 10 elements using logic:iterate in struts with hiernate from database.

4559


Define struts?

1091


Why do we use struts?

1207


What are the sections into which a strut configuration file can be divided?

1106


Explain the difference between plain-validator and field-validator in struts?

1003


What do you mean by tiles in struts?

1069


What is the purpose of @key?

1104


What is difference between interceptors and filters?

1078


What is the difference between shocks and struts?

1004


What are the classes used in struts?

1136


What is the use of jsonvalidation?

1174


What is struts.devmode?

1097