OCA Java SE 8 Core Java APIs - OCA Mock Question Core Java APIs 1-2








Question

Which are true statements? (Choose all that apply)

  1. An immutable object can be modified.
  2. An immutable object cannot be modified.
  3. An immutable object can be garbage collected.
  4. An immutable object cannot be garbage collected.
  5. String is immutable.
  6. StringBuffer is immutable.
  7. StringBuilder is immutable.
  8. String is mutable.




Answer



B, C, E.

Note

Immutable objects can be garbage collected.

String is immutable.

StringBuilder is mutable.

StringBuffer is mutable.