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 a class immutable?

Answer Posted / venkata siva reddy

1.Make the class as final.
2.Make all the properties (variables) as private and final
3.Provide only getter methods for variables.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we catch more than one exception in a single catch block?

1074


What is are packages?

1031


What are selection structures?

996


Is there a sort function in java?

962


Which is fastest collection in java?

1076


Explain what access modifiers can be used for variables?

1056


What are the advantages of inner classes?

1020


From the two, which would be easier to write: synchronization code for ten threads or two threads?

1051


Why use string handling in Java?

1026


Why put method is idempotent?

907


What do you mean by Function Overloading in java?

1176


What is an escape character in java?

1034


Explain, java is compatible with all servers but not all browsers?

1059


Explain wait() method of object class ?

1222


What is string pooling concept?

1069