BooleanTest.java



/** boolean型のデータを取り扱う */
public class BooleanTest {

  /** 処理の開始 */
    public static void main( String[] argv ) {

        boolean b = true;
        System.out.println( "true value is " + b );
        b = false;
        System.out.println( "false value is " + b );
        b = !true;
        System.out.println( "!true value is " + b );
        b = !false;
        System.out.println( "!false value is " + b );
        b = ( 10 < 100 );
        System.out.println( "10 < 100 value is " + b );
        b = ( 10 > 100 );
        System.out.println( "10 > 100 value is " + b );
        b = ( 10 < 100 && 10 > 100 );
        System.out.println( "10 > 100 && 10 < 100 value is " + b );
        b = ( 10 < 100 || 10 > 100 );
        System.out.println( "10 > 100 || 10 < 100 value is " + b );
    }
}