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 qms certification?

953


Can a private method of a superclass be declared within a subclass?

1032


What does arrays sort do in java?

1013


What is a stack class in java ?

1104


How will you communicate between two applets?

1155


What are the different ways of creating thread?

1006


What invokes a thread's run() method in java programming?

1184


Is string is a data type in java?

1049


What is close method? How it's different from Finalize & Dispose?

1060


What does a void function return?

997


How do generics work?

937


What are the types of methodology?

1088


How do you represent a space in regex java?

1010


Can we call virtual funciton in a constructor ?

2197


What is the purpose of the file class in java programming?

1017