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 make class immutable

Answer Posted / vijayakumar chinnasamy

Steps:
1. Create class as final class
2. Make all the properties i.e instance variable as final.
3. Avoid or make the least access for the setter method
for properties.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell us something about set interface.

953


Is empty list java?

871


What is generics in java interview questions?

1000


write a program that list all permutations of ABCDEF in which A appears before B?

2436


What is a java developer salary?

915


What are the differences between include directive and include action?

1078


What is a website container?

896


How does enum work in java?

960


What is a map? What are the implementations of map?

1035


Can you explain the meaning of aggregation and composition

936


What is extension method in java?

984


What is difference between iterator and enumeration in java?

939


What are classloaders?

962


Explain the difference between jvm and jre?

974


What are sets in java?

887