What is an immutable object, JAVA Programming

What is an immutable object?

An immutable object is one that we can't change once it's created. Steps involved in creation of an immutable object are:

Make all of its data fields private.

Methods that can perform changes in any of the data fields after construction of object should be avoided.


Posted Date: 9/9/2013 2:03:37 AM | Location : United States

Related Discussions:- What is an immutable object, Assignment Help, Ask Question on What is an immutable object, Get Answer, Expert's Help, What is an immutable object Discussions

Write discussion on What is an immutable object
Your posts are moderated
Related Questions
Write a program that uses one of the Map classes to implement a contact list. Contact information should include first name, last name, a phone number and an email address. The lis

What is Constraints explain with example? One of the purposes to use constructors and setter techniques rather than directly accessing fields is to enforce constraints. For exa

Describe, in general, how java garbage collector works?

I need to get how to start the java program to evaluate the simillarity.

What is the use of UnicastRemoteObject in RMI? Ans) The UnicastRemoteObject class gives support for point-to-point active object references using TCP streams. Objects that need

We need a very good iOS and/or Android developer preferred to be from Egypt. He will be responsible in developing iOS or/ and Android apps for a company. All details will be provid

What is the difference between Internet and Intranet ? Intranet and internet are 2 domains which are extremely a like but frequent segregated in order to manage security. Inter

what are Objects and Fields in java