This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About String" Watch "About String" New topic
Author

About String

Aftab Ahmed
Ranch Hand

Joined: Nov 22, 2000
Posts: 42
Hi frnds,
in some book i read that but dont understand this
(when u create String object it cant change value)
can anybody tell me about this.
thanx


Keep Simlling
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Aftab, the book is correct. String objects are immutable. i.e. thay can not me changed or modified. Anything that seems like it is changing the string such as concat(), +, etc. is actually creating a new string object.
Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
Consider Paul's rocket mass heater.
 
subject: About String
 
Similar Threads
Assignments on Strings
Document to String
String concatenation
String Problem
change a string