if ( fiber >= 4 || foam >= 3 )
System.out.println("House passes the code requirements!" );
else
System.out.println("House fails." );
Here is what would happen if a house had 6 inches of fiberglass batting and 0 inches of plastic foam:
fiber >= 4 || foam >= 3 --------- --------- true false --------------- true
One true is enough.
AND is different from OR. Both of them combine Boolean values ( true/false values ) into one Boolean value. But each does it in a different way: