boolean is another primitive typetrue and
false
Operator Example Meaning ==i == kequals? (same values?) !=i != 0not equal to? <i < 0less than? <=i <= kless than or equal to? >i > 0greater than? >=i >= kgreater than or equal to? 
boolean values.  For example,
the method call fish.atWall() will return true
if the fish is at the wall (and facing the wall), and will return
false otherwise.  (See the AquaFish class documentation.)
boolean variables.  For example,
    int i = 2;
    int k = 3;
    boolean same = i == k;               // same will be false
    boolean iIsSmaller = i < k;          // iIsSmaller will be true
    boolean isAtWall = fish.atWall();    // isAtWall will be true if the
                                         // fish is at the wall
boolean expressions are frequently used in conditional
statements (next topic).