operator && cannot be applied to boolean
March 9th, 2009
Applies to:
NA
Description:
A boolean operator is being used with an operand that does not equal to true or false
Cause:
The AND (&&) operator is used with integer or floating point operands inside an if or while statement:
int x = 2, y = 3, z = 2;
if ( x == y && z )
System.out.println( “Errorl” );
Use only the AND (&&) operand with operands that evaluate to true or false.
Example:
int x = 2, y = 3, z = 2;
if ( x == y && x==z )
System.out.println( “Correctl” );