• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in JAVA by
Q:

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 8 in JAVA by SakshiSharma
0 votes
asked Apr 8 in JAVA by SakshiSharma
...