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

What is meant by vector class, dictionary class, hash table class, and property class?

1085


What interface is extended by awt event listeners?

1008


What is the gregoriancalendar class in java programming?

975


What is the purpose of static keyword in java?

908


What is currentthread()?

937


Can memory leak in java?

984


What is the difference between serializable and externalizable interface?

1033


Is java developer a good career?

964


How do you reverse sort a list in java?

897


What is an enumeration?

1004


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

1037


Does string isempty check for null?

964


Why convert an applet to an application?

1044


What is JFC?

1160


Explain the different forms of polymorphism?

955