What is the difference between Boolean.TRUE and true in Java?

后端 未结 7 1212
情歌与酒
情歌与酒 2020-12-15 03:02

PS: I understand the difference between \"true\" and true.

Edit: I also understand that Boolean.TRUE is a wrapper for the primitive true, my question then is - why d

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-15 03:53

    true is of the primitive boolean type while Boolean.TRUE is a Boolean object that wraps the true value.

提交回复
热议问题