r/badcode • • Jun 23 '20

java 'val' is a boolean value.

Post image
1.0k Upvotes

58 comments sorted by

View all comments

Show parent comments

3

u/someone4else Jun 24 '20

Well, if you use Boolean, then you can get this

4

u/[deleted] Jun 24 '20

Pretty sure it doesn't work because a Boolean doesn't equal to true or false, you'd have to call the Boolean.booleanValue() method

9

u/Kernel_Internal Jun 24 '20

autoboxing yo

3

u/[deleted] Jun 24 '20

Ahh I stand corrected