public class TestBoolean
{
    public static void main(String args[])
    {
    	boolean t=true;
    	boolean f= !t;//f=false;と同じ結果になる
    	//
    	System.out.printf( "%-7s  %-7s %-7s %n", "a & b", "b=true", "b=false");
    	System.out.printf( "%-7s  %-7b %-7b %n", "a=true" , t & t , t & f);
    	System.out.printf( "%-7s  %-7b %-7b %n", "a=false", f & t , f & f);
    	//printfはC言語の標準関数に類似した書式付書き出しメソッド
    	//%bはboolran型の書式指定子　オプションの-7は左詰めで7文字の指定
    	//%nは環境に応じた改行コードに変換される
    	System.out.println();
    	System.out.printf( "%-7s  %-7s %-7s %n", "a | b", "b=true", "b=false");
    	System.out.printf( "%-7s  %-7b %-7b %n", "a=true" , t | t , t | f);
    	System.out.printf( "%-7s  %-7b %-7b %n", "a=false", f | t , f | f);
    }
}
/*
a & b    b=true  b=false
a=true   true    false
a=false  false   false

a | b    b=true  b=false
a=true   true    true
a=false  true    false
*/