Browse - Programming Tips - How can I put a special value into an int to indicate something

Date: 2013oct15
Language: Java

Q.  How can I put a special value into an int to indicate something
about it?  I get an error doing:

int myint = null;
A. You can not set int to null. But you can use Integer, like this;
Integer myint = null;
Just remember to use myint.equals(something) instead of == Another approach:
int myint = Integer.MAX_VALUE; int myint = Integer.MIN_VALUE;