aspose file tools*
The moose likes Beginning Java and the fly likes immutable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "immutable" Watch "immutable" New topic
Author

immutable

eswar kumar
Ranch Hand

Joined: Oct 20, 2002
Posts: 98
what is immutable? what are the other immutable objects available in Java except string?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

An immutable object is one whose state cannot change; it represents a constant of some kind. java.lang.Integer, Long, Short, Character, Byte, Float, and Double are some of the other immutable classes in the JDK. There are others, and of course anyone can write an immutable class.


[Jess in Action][AskingGoodQuestions]
Zeeman Chen
Greenhorn

Joined: Oct 30, 2003
Posts: 9
check this out
http://mindprod.com/jgloss/immutable.html


If a man take no thought at what is distant, he will find sorrow near at hand. ~ Confucius
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

... or this...
Steve Roderick
Greenhorn

Joined: Mar 15, 2003
Posts: 5
My mate went for a job interview in java and they asked him how "they could change a string by passing it into a method". ANSWER they can't, or use a StringBuffer
[ November 27, 2003: Message edited by: Steve Roderick ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: immutable