Test your knowledge
A class that exposes mutable fields will:
Generate immutable instances.
Generate mutable instances.
Generate mutable classes but immutable instances.
Which of the following keywords, used within a constructor, allows us to call other constructors with different arguments defined in our class:
selfconstructorthis
An object that cannot change its state after it has been initialized is known as:
A mutable object.
An immutable object.
An interface object.
In Java 9,
java.lang.Stringgenerates:An immutable object.
A mutable object.
An interface object.
If we call the
toUpperCasemethod for ajava.lang.String, the method will:Convert the existing
Stringto uppercase characters and change its state.Return a new
Stringwith the contents of the originalStringconverted to uppercase characters.Return a new
Stringwith the contents of the originalString.