ramamohan gogula

Greenhorn
+ Follow
since Mar 29, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by ramamohan gogula

Hi, My name is Ramamohan and learned java technologies like core java and servlets and jsp and struts and hibernate ........
I completed MCA 2011 i put resume in job portals but didn't get any mails or calls as a frehser of java
what should i do........
How to get opprtunity with organization.
current Location is Bangalore..
please provide information
9 years ago
can any body tell me the wt is the situation scjp certification weather it is helping to get a job or not.......
some people says it is waste now a days and also fees more.....

Tim Weide wrote:Why would you want to write a mutable class?



if want to perform any modification on existing object with those changes a new Object will be created this concept is nothing but immutability......

sample code is

final public class MyImmutable{
private int var1=0;
public MyImmutable(int var1){
this.var1=var1;
}
public MyImmutable getModify(int var1){
if(this.var1==var1){return this;}
else
return new MyImmutable(var1);
}
}