• Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding string immutable  RSS feed

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all can any one explan string is immutable --> what is mean by it with any example

Thanks & regards
SAm
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It means that whatever method you call on it, it never changes the String object.

An example:

Instead, all methods return a new String object.
 
sam dims
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
It means that whatever method you call on it, it never changes the String object.

An example:

Instead, all methods return a new String object.


Thanks
 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam,

I would suggest you to try many examples to test String's immutability.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!