I\'m a newbie Java coder and I just read a variable of an integer class can be described three different ways in the API. I have the following code:
if (count.
well i might be late on this but i would like to share something:
Given the input: System.out.println(isGreaterThanZero(-1));
public static boolean isGreaterThanZero(Integer value) {
return value == null?false:value.compareTo(0) > 0;
}
Returns false
public static boolean isGreaterThanZero(Integer value) {
return value == null?false:value.intValue() > 0;
}
Returns true So i think in yourcase 'compareTo' will be more accurate.