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:
self
constructor
this
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.String
generates:An immutable object.
A mutable object.
An interface object.
If we call the
toUpperCase
method for ajava.lang.String
, the method will:Convert the existing
String
to uppercase characters and change its state.Return a new
String
with the contents of the originalString
converted to uppercase characters.Return a new
String
with the contents of the originalString
.