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

What do you mean by compiler?

983


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

1161


How to use arraylist in java netbeans?

974


What is the relationship between class and object?

979


Can two objects have same hashcode?

941


How does varargs work in java?

1036


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

926


What if constructor is protected in java?

1024


Explain Basics of OOP Language in java

985


make a method which any number and any type of argument and print sum of that arguments.....

1747


What is nextint java?

972


What do you mean by constructor?

921


what is the significance of listiterator in java?

1022


Can we make constructors static?

1165


How transient variable is different from volatile variable?

1014