Nasty UnIndented Nests Write truth tables for the following pieces of Java code; note that a, b are boolean conditions and Y, Z are actions, such as output. 1. if (a) if (b) Y; else Z; 2. if (a) {if (b) Y;} else Z; 3. if (a) Y; else if (b) Z; 4. if (a && b) Y; else Z; The Truth tables: a b 1 2 3 4 F F - Z - Z F T - Z Z Z T F Z - Y Z T T Y Y Y Y If you would want to check the above tables here is code to create such a truth tables class NestedLogic1 { // Does show truth table for 2 booleans a, b public static void main (String args[]) { boolean a, b; a = false; while (true) { b = false; while (true) { System.out.print (a + " "); System.out.print (b + " "); if (a) if (b) System.out.print ("Y"); else System.out.print ("Z"); System.out.println (" "); if (b) break; b = ! b; }//EndWhile b if (a) break; a = ! a; }//EndWhile a }//EndRoutine main }//EndClass NestedLogic