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 / kanchan

To make a class immutable,
1. Don't provide any methods that modify the object.
2. Ensure that no methods may be overridden. Mark the class
as final. Make all fields final and private.

Is This Answer Correct ?    63 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1899


What is the difference between break and continue statements?

1099


What is the difference between interface & abstract class?

1087


What is regex used for?

1045


Write a program in java to establish a connection between client and server?

1020


Does chrome use java?

1026


explain local datetime api in java8?

1060


What does int [] mean in java?

1099


What is entry set in java?

1237


How do you sort data in java?

1005


What is the best definition for data?

1025


What is generic type?

1079


What is the importance of finally block in exception handling?

1084


What is final, finally, finalize?

1192


what are the methods in object?

1205