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.compareTo(0)) {
System.out.println(out_table);
count++;
}
This is inside a loop and just outputs out_table
.
My goal is to figure out how to see if the value in integer count > 0
.
I realize the count.compare(0)
is the correct way? or is it count.equals(0)
?
I know the count == 0
is incorrect. Is this right? Is there a value comparison operator where its just count=0
?