Anderson Souza

Greenhorn
+ Follow
since Oct 12, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Anderson Souza

Hi all,

I have had some doubts when I saw the code below.



Could someome explain me the difference between initializing x and y ??

I would like to undertand why the line "case y:" doesn't compile, I think this is related in the way how the variable was initialized?

Thanks in advance
Hi,

You are absolutely right.

Cheers
Strings are immutable, you can't change string's content, like you can do with a StringBuffer or StringBuilder. But you can change the value of reference, so when you used "r1.setName("Bird");", you were changing the reference of the attribute name.

Cheers.