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 override static methods in java?

1125


How do you sort a string in java?

1022


How do you clear a method in java?

1050


how is final different from finally and finalize in java?

1109


if u open login & logout ,how can udisplay the timelogin & logout members ?

2323


When can an object reference be cast to an interface reference in java programming?

1068


List out five keywords related to exception handling ?

1063


What is difference between static and abstract class?

1063


Can a constructor call the constructor of parent class?

1086


What are the important features of Java 8 release?

1140


What is the use of beaninfo?

1099


What is generic class?

1134


What is the relationship difference the canvas class and the graphics class?

1115


How do you declare an array that will hold more than 64KB of data?

1388


What is the use of System class?

1223