String Objects: Concatenation, Literals, and More

AP Computer Science A· difficulty 4/5

In Java, <code>String</code> objects are

  • A

    Immutable (operations return new strings; original unchanged)

    check_circle
  • B

    Synchronized

  • C

    Always null

  • D

    Mutable (can be modified in place)

Explanation

<code>s.toUpperCase()</code> returns a new string; <code>s</code> itself is unchanged.

Want 10 more like this — adaptive to your weak spots?

Related questions