• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

immutable

 
eswar kumar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is immutable? what are the other immutable objects available in Java except string?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Zeeman Chen
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this out
http://mindprod.com/jgloss/immutable.html
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... or this...
 
Steve Roderick
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic