Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Mutable and immutable Objects
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Deepak Kumar
Mutable and immutable Objects
1 Answer(s)      4 years and 3 months 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

Advertisement
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


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
String immutable - Java Beginners
String immutable  Why is String immutable?  See here Why String is immutable in Java
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 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
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
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
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
Objective C Array
is a collection of number of other objects. In Objective C, we can also add and remove the objects from the given list of array if the array is declared mutable...;Yellow", nil]; or Mutable Array like: NSMutableArray *myMutableArray
count objects php
count objects php  How to Count and show objects in PHP
Are objects passed by value or by reference?
Are objects passed by value or by reference?  Are objects passed by value or by reference
What are the benefits of detached objects?
What are the benefits of detached objects?   Hi, What are the benefits of detached objects? Thanks
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
Benefits of detached objects in hibernate
Benefits of detached objects in hibernate  What are benefits of detached objects in hibernate?   Detached objects can be passed across... Transfer Objects). You can later on re-attach the detached objects to another
Objects in Java
Objects in Java Whatever we can see in this world all the things are a object. And all the objects are categorized in a special group. That group is termed as a class. All the objects are direct interacted with its class that mean
implicit objects in jsp
implicit objects in jsp  hello, how many implicit objects in jsp???   hello, I am giving implicit object out,config,page,application,request,page context,response,session
Transient and detached objects
Transient and detached objects  Explain the difference between transient (i.e. newly instantiated) and detached objects in hibernate
Get Duplicate Objects from an ArrayList of Objects
Get Duplicate Objects from an ArrayList of Objects  public class Order { private String portId; private String action; private String idType; private String id; private BigDecimal amount; public String getPortId
Flex Objects
: #FFFFCC; } Objects are real entity conforming the template or blueprint defined by its class. The class defines the properties and behavior for its objects... objects of these classes according to the need of your application
Java Objects - Java Beginners
Java Objects  Hi I have the following question, What method in Java is used to destroy your objects. Thanks in advance
Program to implement array of Objects.
Program to implement array of Objects.  Create a class it has.... Initialize an array of objects. Pass a name from the command line & search for the name in the array of objects , if it is existing print the information
Objects - Java Beginners
Objects  Hello, assist me crack this programming question. Develop a class to represents a human. The head, arms and legs should be properties of the human and should be represented by separate objects. All of your objects
Advertisements
 

 

 

DMCA.com