Java OCA OCP Practice Question 997

Question

Given a string constructed by calling

s = new String("xyzzy").

Which of the calls modifies the string?

  • A. s.append("mypkg");
  • B. s.trim();
  • C. s.substring(3);
  • D. s.replace('z', 'a');
  • E. s.concat(s);
  • F. None of the above


F.

Note

Strings are immutable.




PreviousNext

Related