operator && cannot be applied to boolean

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” );


admin JAVA-Compiler

  1. admin
    March 9th, 2009 at 18:22 | #1

    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” );

  1. No trackbacks yet.