0 votes
in JAVA by

Which of the following is a mutable class in java?

a) java.lang.String

b) java.lang.Byte

c) java.lang.Short

d) java.lang.StringBuilder

1 Answer

0 votes
by

(d) java.lang.StringBuilder

Reason: A mutable class is a class in which changes can be made after its creation. We can modify the internal state and fields of a mutable class. The StringBuilder class is a mutable class, as it can be altered after it is created.

The String, Byte, and Short are immutable classes as they cannot be altered once they are created.

Related questions

0 votes
asked Apr 9, 2021 in JAVA by Robindeniel
0 votes
asked Apr 8, 2021 in JAVA by SakshiSharma
...