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

create a class , having some private variables and setter
method for that variable , In constructor pass the
arguments to set this variable.

Is This Answer Correct ?    7 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the final access modifier in java?

1007


Why do we need strings in java?

939


How do you do exponents in java?

979


What is the difference between Grid and Gridbaglayout?

1142


What does opcode mean?

1000


When can you say a graph to be a tree?

1027


If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?

1202


What is data string?

882


What is thread life cycle?

915


In the below example, what will be the output?

973


What are the restrictions that are applied to the java static methods?

927


How use .contains in java?

1122


Can we convert stringbuffer to string?

957


Explain an algorithm to find depth of a binary tree.

991


Explain about fail safe iterators in java?

962