An Immutable object is a kind of object whose state cannot be modified after it is created. This is as opposed to a mutable object, which can be modified after it is created. The basic way to create an immutable object is to make all of its data fields private and don't create any methods which can change any of the data fields once the object has been constructed. this code helps you to understands-
package roseindia;
import java.awt.Point;
public class test {
public static void main(String[] args) { Point point1 = new Point(0, 0);// mutable object System.out.println(point1); point1.setLocation(1.1, 1.0); System.out.println(point1); String str = new String("Gyan Singh");// immutable object System.out.println(str); str.replaceAll("Gyan", "Samar"); System.out.println(str); }
}
Output of the code is as follows- java.awt.Point[x=0,y=0] java.awt.Point[x=1,y=1] Gyan Singh Gyan Singh
Related Pages:
Java object Java object Which class should you use to obtain design information about an object
Java object Java object What is mutable object and immutable object? An Immutable object is a kind of object whose state cannot be modified after it is created.
This is as opposed to a mutable object, which can be modified
object creation object creation when will javaobject is created? is it at runtime or compiletime
Object Oriented Object Oriented C++ is Purely object oriented or not .Then why java called purely object oriented
Object Object
An object...). In an
object, variables store values for later use and methods are the unit... are the basic units
of the object-oriented programming.
Objects are the part of our day
Java Object JavaObject
 ... properties of the class or its group. Javaobject
is an instance of the class. It takes.../java-object-oriented-language.shtml
 
Session Object
Session Object Why do we require Session Object? Hello,
In java HttpSession is an interface present in javax.servlet.http package.
The session object is used by the developers to store and retrieve user's
object as argument object as argument what happens when we pass a object into a method???if java is pass by value how does this makes a difference.....pllzzz give me more clarification on why we pass objects in a margument
Object in java - Java Beginners Object in java Hi deepak,
I am new to java, can u tell me what is class ,object and instance with example. For example : class raja , raja r.../java/master-java/java-object-oriented-language.shtml
http
Java object clone Javaobject clone What is criteria for a object to get cloned
java object - Java Beginners java object i want a complete memory description of objects,methods... of objects. The primitive data type and keyword void is work as a class object.
Object: Object is the basic entity of object oriented programming language
Java object's lock Javaobject's lock What is an object's lock and which object's have locks
implect object
implect object how i implment implect object
Hi Friend,
Please visit the following links:
http://www.roseindia.net/help/java/o/jsp-implicit-objects.shtml
http://www.roseindia.net/jsp/jspfundamentals.shtml
Thanks
Vector object[]
Vector object[] I want to create payslip in java
public Vector...();
Object[] value = new Object[] {"Employee Name",f.ename.getSelectedItem()};
rec.add(value);
value = new Object[] {"Mary-Kate Olsen", "Ashley
java object - Java Beginners java object i want to where in the memory the java objects,local... are stayed Hi friend,
Instance Variables (Non-static fields): In object... fields" that is declared without the static keyword. Each object of the class has its
java object class methods javaobject class methods What are the methods in Object class? There are lots of methods in object class.
the list of some methods are as-
clone
equals
wait
finalize
getClass
hashCode
notify
notifyAll
Object class in java Object class in java want an example and with an explaination about equals() method in object class?
Is equals() is similar
java is pure object oriented java is pure object oriented java is pure object oriented or not.? reason.?
Java is not pure object oriented language because... are not object
2)It does not support operator overloading multiple inheritance.
3
bean object
");
rd.forward(req, res);
}
}
3)beandata.jsp:
<%@page language="java...;
For more information, visit the following links:
http://www.roseindia.net/jsp/java
object creation - Java Beginners object creation I need object creation in depth(with stack,pc registers).Any one can provide me if possible with video/audio
object conversion - Java Beginners object conversion Hi,
Can anybody tell me the object conversion in java.
Hi sandeep
Can u please tell me in details about your query, otherwise u may got help from here,
http://www.roseindia.net/java
object - Java Interview Questions
?
Hello,
i know only two wayes of object instansiations
1....
Thankx
Hi Friend,
Yes we can create an object in the following... of creating an object.
ClassName classObject = new ClassName();
2. Using
Object serialization - Java Beginners Object serialization Design classes for Currency, Rupee, and Dollar. Write a program that randomly generates Rupee and Dollar objects and write them into a file using object serialization. Write another program to read
vector object - Java Beginners
vector object hi i have created a Vector vec=new Vector(); vec.addElement(o); o is an object of group(acl.group) what i have to do to read contents of this object? can it be possible to convert it into string arrays
java : object oriented java : object oriented (a) Write a class named CarRental... the user for the data needed for a rental and creates an object of the correct... an object of the correct type. Display the total rental fee
Is Java a pure object oriented language?
Is Java a pure object oriented language? Hi,
Is Java a pure object oriented language?
thanks
Hi
No, Java is an object oriented programming language but not purely a object oriented language. In OOPs programming
Deserializing an Object in java
Deserializing an Object in java
 ....
The given program shows how to read any data or contents from the
serialized object or file. It takes a file
name and then converts into javaobject. If any exception
object retun type - Java Beginners object retun type Hi,
i have to create a method which should have return type of object . The object should contain 'list of filenames' array and a boolean field 'isVal'. Can anybody help
object 2 string - Java Beginners object 2 string hi sir,how to convert object to string
and
how 2 compare object with null value to string with null value
plz provide a program 4 this sir,plzzzzzzzzz
What are the methods in Object? - Java Beginners
What are the methods in Object? Hi,
What are the methods in Object? Give example of methods in Object.
Thanks
Hello,
There are lot of method in object class some of are as follows
toString();
wait
Insert an object with the add(Object) method
Insert an
object with the add(Object) method
In this section you will learn to
insert an
object at the end of a list
using the add(Object) method. Here is an example that
provides
Serializing an Object in Java
Serializing an Object in Java
 ... of object
i.e. reused by the JVM (Java Virtual
Machine). This process... of saving an object
in a storage medium (such as a file, or a memory buffer
Data Access Object
Data Access Object Hi sir/madam please give me some tutorial/example about Data Access Object
Hi Please Find the example of Java Data Access Object
http://www.roseindia.net/tutorial/java/jdbc
object oriented programming - Java Beginners object oriented programming sir,
i read in the book tat object oriented program exhibits recurring structures.
i want to know "what is meant by recurring structures?" Hi Friend,
Any structure to be occurred over
ResultSet object initialization - Java Beginners
ResultSet object initialization How to initialize resultset object Hi friend,
public interface ResultSet
A ResultSet object maintains a cursor pointing to its current row of data.
A default ResultSet object
Page object - JSP-Servlet
of PAGE object of implicit JSP object. If this is possible explain me about it's methods. I did not find any methods or explanation of this object. Pls help me... that are automatically available in JSP. Implicit Objects are Java objects that the JSP
OBJECT CLASS - Java Interview Questions OBJECT CLASS How To Find Out How many Objects Create?How Many Object Are Reachabule To Garbage Collector?i want Source code Plz Help me........?urgentttttttttttttt To find the number of objects created
String and stringbuffer object - Java Beginners
String and stringbuffer object Hi,
What is the basic difference between string and stringbuffer object?
Thanks
Hi Friend,
Differences:
1)String class is used to manipulate character strings that cannot
jsp object retrieval - Spring
jsp object retrieval I have a controller which calls a Service.... However, I am concerned this object could be huge in some instances. Any...://www.roseindia.net/jsp/
Thanks for the reply but I want to keep the java
Object-Oriented programming - Java Beginners Object-Oriented programming Write a program to display the names and salaries of 5 employees.Make use of a class and an array.The salary of each employee should increase by 5% and displayed back. Hi friend,
Code
Object oriented program - Java Beginners Object oriented program Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
Java file object Java file object
This section demonstrates you the concept of File object... object.
Using the File object, you can perform several operations. It parses... in functions
which shows their utility by just calling them through the object, like
object oriented program.. - Java Beginners object oriented program.. Write a class called RaceCar.java that contains instance variables horsepower, weight, zeroTo60, and milesPerGal. The value of zeroTo60 (in second) is determined by the formula zeroTo60 = weight
object
object is it possible to create object in the same class..?.
Yes, you can.
class CreateObject
{
CreateObject(){
System.out.println("I have an object.");
}
public static void main(String[] args
Accessing the object information - Java Beginners
Accessing the object information Authors.java
import java.util.*;
import jsns.model.AbstractAgent;
import jsns.model.IAgentActor;
import jsns.model.IAgentSensor;
import jsns.model.IEnvironment;
import
Switching on Object Handles - Java Tutorial
Switching on Object Handles
2001-04-26 The Java Specialists' Newsletter [Issue 017a] - Switching on Object Handles
Author:
Dr. Heinz M. Kabutz....
Welcome to the 17th issue of "The Java(tm) Specialists'
Newsletter", after a few
Java Value Object Pattern
-left: 440px;
}
Value Object Pattern
Some entities contains a group.... To come out from this problem you can
Value Object Design Pattern. It encapsulate all the data as a single object and
provide a single method to send