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
Performance of interpreted byte codes is sufficient but it can be improved much more than that. Byte codes are changed into machine language within no time, this speed of implement

Class variables are named as static variables. There is only single occurrence of a class variable per JVM per class loader. When a class is operated the class variables are in

Question: (a) Describe what is meant by a ‘constructor' in Java. Use a simple example to illustrate your answer. (b) Differentiate between a class method and an instance me

In addition to your Java code requirements, you also need to enhance the ZHTML for your application. As before, you can continue working with the page(s) you used for the previous

Struts is depend on model 2 MVC (Model-View-Controller) architecture. Struts controller uses the command design pattern and the action classes use the adapter design pattern. The p

Advantages offered by SOA Splits down the silos of data, functionalities, and applications into enterprise services. Adapts an application to changing business requirements

What is the problem along with Relational Database and what solution you could suggest for it? When we store object orientated data within RDBMS it required to translate in to

Since there are only a finite number of bonds available in the market. There will always be "holes" to fill in when defining a yield curve in continuous time. A common approach is

Differentiation between if statement and a switch statement ?

Different modules in spring framework are:- a)  The Core container module b)  AOP module (Aspect Oriented Programming) c)  Application context module d) JDBC abstractio