Mutable and immutable Objects

Ads

 
 

Share on Google+Share on Google+

Deepak Kumar
Mutable and immutable Objects
1 Answer(s)      7 years ago
Posted in : Java Beginners
Hi,

Please tell me about Mutable and immutable Objects.

What is mutable object and immutable object and how to use it correctly.

Thanks
Ads
View Answers

October 5, 2010 at 5:49 PM


Hello,
Mutable are those object which we can alter. like any primitive. Immutable are those object whcih we can not alter like String
ex String s = "hello"
create a new object in string pool "hello" reffrenced by s

s = "hi"
create new string "hi" refrenced by s. above "hello" obj is still in string pool only the reffrence s is now maped to "hi".

Thanks

Ads









Related Tutorials/Questions & Answers:
Mutable and immutable Objects - Java Beginners
Mutable and immutable Objects  Hi, Please tell me about Mutable and immutable Objects. What is mutable object and immutable object and how to use it correctly. Thanks   Hello, Mutable are those object which
what is mutable and immutable object in java ?difference ?
what is mutable and immutable object in java ?difference ?  what is mutable and immutable object in java ?difference
Advertisements
immutable class
immutable class  How to make a class immutable
change value of mutable string
change value of mutable string  How to change value of mutable string
Mutable Image
Mutable Image       This is the Mutable image example which shows how to create the mutable image using canvas class. In this example the ImageCanvas1 class extends the Canvas
String immutable - Java Beginners
String immutable  Why is String immutable?  See here Why String is immutable in Java
STRING IMMUTABLE - Java Interview Questions
STRING IMMUTABLE  Why string objects are immutable? what... efficiency instead of creating the new String objects. So, whenever you create... in the pool. There will be many references point to the same String objects
IMMUTABLE - Java Interview Questions
IMMUTABLE  How To Make A Class Immutable?  Hi Friend, To make a class immutable we must restrict changing the state of the class...; } } public class Immutable{ public static void main(String[] args
Version of com.dampcake>gson-immutable dependency
List of Version of com.dampcake>gson-immutable dependency
Version of com.qifun>immutable-future_2.10 dependency
List of Version of com.qifun>immutable-future_2.10 dependency
Version of com.qifun>immutable-future_2.11.0-RC4 dependency
List of Version of com.qifun>immutable-future_2.11.0-RC4 dependency
Objects
Objects       Objects In this section we are going to illustrate how the real life objects are the key to understand object-oriented technology Objects are the part of our day to day
Maven Dependency gson-immutable >> 1.0
You should include the dependency code given in this page to add Maven Dependency of com.dampcake >> gson-immutable version1.0 in your project
Maven Dependency gson-immutable >> 1.1
You should include the dependency code given in this page to add Maven Dependency of com.dampcake >> gson-immutable version1.1 in your project
Maven Dependency gson-immutable >> 1.1.1
You should include the dependency code given in this page to add Maven Dependency of com.dampcake >> gson-immutable version1.1.1 in your project
Maven Dependency gson-immutable >> 1.2
You should include the dependency code given in this page to add Maven Dependency of com.dampcake >> gson-immutable version1.2 in your project
Maven Dependency immutable-future_2.10 >> 0.1
You should include the dependency code given in this page to add Maven Dependency of com.qifun >> immutable-future_2.10 version0.1 in your project
Maven Dependency immutable-future_2.11.0-RC4 >> 0.1
You should include the dependency code given in this page to add Maven Dependency of com.qifun >> immutable-future_2.11.0-RC4 version0.1 in your project
Immutable Image using Canvas Class
Immutable Image using Canvas Class       This is the immutable image example which shows how to create the immutable image using canvas. In this example ImageCanvas class
Immutable Image MIDlet Example
Immutable Image MIDlet Example       This is the immutable image example, which shows how to create a immutable image in MIDlet. In this example we are creating
Implicit objects
Implicit objects  What are the implicit objects
Data objects
Data objects   hello,, What are data objects?   hii, Sequences, Views, clusters, Tables, index and cluster are called data objects for a database
Java Objects
Java Objects  What are Data Transfer Objects and where are they used
classes and objects
classes and objects  Define a class named Doctor whose objects are records for a clinic√Ę‚?¨‚?Ęs doctors. Derive this class from the class Person... and Billing, whose objects are records for a clinic. Derive Patient from
Classes and Objects
Classes and Objects       Objects... the main() method.  A class can have more than one instances (objects), let us... techniques. A class defines the properties of  objects and methods used
Are objects passed by value or by reference?
Are objects passed by value or by reference?  Are objects passed by value or by reference
count objects php
count objects php  How to Count and show objects in PHP
class with in its own objects?
class with in its own objects?  Is it a good idea to declare a class with in its own objects
What are the benefits of detached objects?
What are the benefits of detached objects?   Hi, What are the benefits of detached objects? Thanks

Ads

 
Advertisement null

Ads