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
(Package Inheritance Hierarchy) Package-delivery services, such as FedEx®, DHL® and UPS®, offer a number of different shipping options, each with specific costs associated. Create

The File class encapsulates the files and directories of the local file system. The RandomAccessFile class gives the methods required to directly access data contained in any part

Give an example for Using Getter Methods ? class CarTest6 { public static void main(String args[]) { Car c = new Car(); c.setLicensePlate("New York A45 636"); c.setMa

We need to create an Android application. The application is about registering courses in a university, viewing grades, available courses and evaluating faculty members. Advisor

What are the different messaging paradigms JMS supports? Ans) Publish and Subscribe i.e. pub/suc and Point to Point i.e. p2p.

Question 1: (a) What are the disadvantages of using HTML Frames in your web pages? (b) Give five examples of controls used inside HTML forms and the situation in which the

Normal 0 false false false EN-US X-NONE X-NONE

Need assignment help , on the topic “Demonstrate a console-program” Demonstrate a console-program to create an array of integers and Initialize the array and assign the values i

Super() Constructer: It is used to call constructor of parent class. Should be the first statement in the body of constructor. Using this we can access private variables

Annotation or Attribute oriented programming There are two types of code generation processes. Passive code generation: is template driven . Input process are used in mo