OCA Java SE 8 Core Java APIs - OCA Mock Question Core Java APIs 1-2
Question
Which are true statements? (Choose all that apply)
- An immutable object can be modified.
- An immutable object cannot be modified.
- An immutable object can be garbage collected.
- An immutable object cannot be garbage collected.
- String is immutable.
- StringBuffer is immutable.
- StringBuilder is immutable.
- String is mutable.
Answer
Note
Immutable objects can be garbage collected.
String is immutable.
StringBuilder is mutable.
StringBuffer is mutable.