Are all primitive wrapper classes immutable objects?

后端 未结 4 2026
逝去的感伤
逝去的感伤 2021-02-07 02:31

Are all primitive wrapper classes in Java immutable objects? String is immutable. What are the other immutable objects?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-07 02:51

    Yes, of course. Wrapper classes are immutable.

    You can read Why wrapper classes are immutable in java? to understand the immutability of wrapper classes.

提交回复
热议问题