Hi,
I have got confused by the answers to the exercise questions in the book of JAMIE JAWORSKI at the end of the chapter explaining Strings and
String Buffer.
Q5- (page 218)
Which of the following methods cause the String object referenced by s to be changed ?
A- s.concat()
B- s.toUpperCase()
C- s.replace()
D- s.valueOf()
And the answer given is A & B. With the explanation that "The toUpperCase() and concat() change their associated String Objects.
While when i put them in codes and run, the original String is returned and that is not changed untill we assign like
s = s.concat()
What is the problem here ?