This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes immutable class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "immutable class?" Watch "immutable class?" New topic

immutable class?

Kevin Peterson
Ranch Hand

Joined: Mar 05, 2005
Posts: 37
Could someone please give me an example of an immutable class from the J2SE 1.4.2 sdk?

Thanks, Kp
Sean Magee
Ranch Hand

Joined: Aug 23, 2004
Posts: 69
String j = " I am immutable";

All String are immutable, besides that im not sure.
[ March 06, 2005: Message edited by: Sean Magee ]
Kevin Peterson
Ranch Hand

Joined: Mar 05, 2005
Posts: 37
Thanks, i kick myself for not thinking of that example.

David Harkness
Ranch Hand

Joined: Aug 07, 2003
Posts: 1646
What method in Integer do you use to change its value? And Double?
I agree. Here's the link:
subject: immutable class?
It's not a secret anymore!