How do I check if an integer is null?

If you want an integer to be able to be null, you need to use Integer instead of int . @sharonHwk “person == null” should be the better option. If person is null, it won’t have a “equal” method, then “person. equals(null)” throws.

Sizin İçin Seçtik  How do you insert a null check?

Leave a Reply

Your email address will not be published. Required fields are marked *

How do I check if an integer is null?

If you want an integer to be able to be null, you need to use Integer instead of int . @sharonHwk “person == null” should be the better option. If person is null, it won’t have a “equal” method, then “person. equals(null)” throws.

Sizin İçin Seçtik  How do you insert a null check?

Leave a Reply

Your email address will not be published. Required fields are marked *