// TruthValues.java (c) 2003 Kari Laitinen // http://www.naturalprogramming.com // 2003-04-12 File created. // 2004-10-10 Last modification. // This program shows how the truth values of three // relational expressions change when a loop is // executed. class TruthValues { public static void main( String[] not_in_use ) { int left_integer = 4 ; System.out.print( "\n left right < >= != \n" ) ; for ( int right_integer = 0 ; right_integer < 7 ; right_integer ++ ) { System.out.print( "\n " + left_integer + " " + right_integer ) ; boolean first_truth_value = ( left_integer < right_integer ) ; boolean second_truth_value = ( left_integer >= right_integer ) ; boolean third_truth_value = ( left_integer != right_integer ) ; System.out.print( " " + first_truth_value + " " + second_truth_value + " " + third_truth_value ) ; } } }