public class Booleantest { public static void main(String[] args) { System.out.println("a \t b \t c \t a && b || !c"); System.out.println("-------------------------------------"); for(int i=0; i<=1; i++) for(int j=0; j<=1; j++) for(int k=0; k<=1; k++) { boolean a = i>0; boolean b = j>0; boolean c = k>0; System.out.println(a + "\t " + b + "\t " + c + "\t " + (a && b || !c)); // System.out.println(a + "\t " + b + "\t " + c + "\t " + (!c || a && b)); // System.out.println(a + "\t " + b + "\t " + c + "\t " + (a && (b || !c))); } } }