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

What is parse method?

1018


What about main() method in java ?

1019


What is an example of procedure?

1036


Explain the difference between string, stringbuffer and stringbuilder in java?

1002


What is jit and its use?

990


What are pass by reference and pass by value?

988


What is function and its uses?

1120


What is flag in python?

1035


Is zero a positive integer?

1064


What is arraylist e in java?

1058


Lowest Common ancestor in a Binary Search Tree and Binary Tree.

931


Is it possible to specify multiple jndi names when deploying an ejb?

996


What does java se mean?

1027


What is the use of jtable?

1126


What is the difference between procedural and object-oriented programs?

973