Welcome to DrJava. Working directory is C:\Users\Classroom\Desktop > int x = if (true) 4; else 5; Invalid variable declaration > if (true) 4; else 5; Expression statement required > if (true) System.out.println(5); else System.out.println(4); 5 > true ? 4 : 5 4 > false ? 4 : 5 5 > int x = true ? 4 : 5 > x 4 > // exp ? exp : exp > 5 + (true ? 6 : 2) 11 > > int x = int y = 5; Incomplete expression > > int x = 6; > int y = 7; > x = y = 0; > x 0 > y 0 > x + (y = 5) 5 > x = 10 10 > y = 0 0 > x = x + (y = 100) 110 > x 110 > x = y = x = y = x = y 100 > x = (y = (x = (y = (x = y)))) 100 > int b = 8 > x = (y + (y=8) + (y=9)) 117 > y 9 > x = (y + (y=8) + (y++)) 25 > y 9 > x = (y + (y=3) + (y++)) 15 > y 4 > > > if (true) System.out.println(5); else System.out.println(4); 5 > if (true) x = 5; else x = 15; > x = if (true) 5; else 15; Invalid top level statement > > > int a = 0; > String b = "cat" > if (true) a = 9; else b = "dog"; > a 9 > b "cat" > > > String a2 = true ? Integer.toString(45) : "cat".substring(0,1) > a2 "45" > 5 + (true ? 5 : 6.4) 10.0 > 5 + (true ? 5 : 6) 10 > 5 + (true ? "5" : "6") "55" > 5 + (true ? "5" : 6) Static Error: Bad type in addition > true ? "5" : 6 "5" > false ? "5" : 6 6 > false ? "cat" : 6 6 > true ? "cat" : 6 "cat" > "dog" + (true ? "cat" : 6) "dogcat" > "dog" + (false ? "cat" : 6) "dog6" >