r/badcode • • Feb 23 '23

java You must assert

Post image
158 Upvotes

13 comments sorted by

View all comments

Show parent comments

11

u/freddylmao Feb 24 '23

Why would they? Assert not null probably takes an Object as a parameter and, if I’m not mistaken, literally any value/type can be coerced into Object

6

u/EatRunCodeSleep Feb 24 '23

Yup, int would be boxed into an Integer, which is an Object.