Self-Review Exercises

29.1

State whether each of the following is true or false. If false, explain why.

  1. When String objects are compared using ==, the result is true if the Strings contain the same values.
  2. A String can be modified after it is created.

29.2

For each of the following, write a single statement that performs the indicated task:

  1. Compare the string in s1 to the string in s2 for equality of contents.
  2. Append the string s2 to the string s1, using +=.
  3. Determine the length of the string in s1.

Категории