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

Explain the difference between association, aggregation and inheritance relationships.

1099


How to use Media tracker Class.

1142


What does provide mean construction?

1110


what do you mean by stream pipelining in java 8? Explain

1034


Can a class have 2 constructors?

909


What is the difference between integer parseint and integer valueof?

1012


Does java set allow duplicates?

1092


State the merge-sort principle and its time complexity.

986


What is a file pointer?

1090


How big is a boolean?

1050


What is flag in python?

1042


What are runtime exceptions?

1168


How to perform linear search in java?

963


Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?

1038


Explain the difference between jvm and jre?

1042