boolean b1 = false; boolean b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b1 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2));
=== false false === false true === true true === false true
=== false false === true false === true true === false true
=== false false === false true === true true === true false
=== false false === true false === true true === true false
boolean b1 = false; boolean b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b1 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2));
=== false true === false false === false true === true true
=== false true === false false === true false === true true
=== true false === false false === false true === true true
=== true false === false false === true false === true true
boolean b1 = true; boolean b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b1 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2));
=== false true === true true === false true === false false
=== false true === true true === true false === false false
=== true false === true true === false true === false false
=== true false === true true === true false === false false
boolean b1 = true; boolean b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b1 = false; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2)); b2 = true; System.out.println("==="); System.out.println((b1 && b2) + " " + (b1 || b2));
=== true true === false true === false false === false true
=== true true === false true === false false === true false
=== true true === true false === false false === false true
=== true true === true false === false false === true false
boolean p = false; boolean q = false; boolean conjunction = p && q; boolean disjunction = p || q; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction); p = true; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction);
=== true true === true true
=== true true === true false
=== false false === false false
=== false false === false true
boolean p = false; boolean q = true; boolean conjunction = p && q; boolean disjunction = p || q; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction); p = true; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction);
=== true false === true false
=== true false === false false
=== false true === false true
=== false true === true true
boolean p = true; boolean q = false; boolean conjunction = p && q; boolean disjunction = p || q; System.out.println("==="); System.out.println(!disjunction); System.out.println(!conjunction); q = true; System.out.println("==="); System.out.println(!disjunction); System.out.println(!conjunction);
=== false true === false true
=== false true === false false
=== true false === true false
=== true false === true true
boolean p = true; boolean q = true; boolean conjunction = p && q; boolean disjunction = p || q; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction); p = false; System.out.println("==="); System.out.println(!conjunction); System.out.println(!disjunction);
=== false false === false false
=== false false === true false
=== true true === true true
=== true true === false true
i >= 5 && 10 >= i
i >= 5 || 10 >= i
i < 5 && 10 < i
i < 5 || 10 < i
17 >= i && i >= 4
17 >= i || i >= 4
17 < i && i < 4
17 < i || i < 4
i >= 5 && 10 >= i
i >= 5 || 10 >= i
i < 5 && 10 < i
i < 5 || 10 < i
17 >= i && i >= 4
17 >= i || i >= 4
17 < i && i < 4
17 < i || i < 4
int i = 5; int j = 7; int k = 9; String s = "Hello "; System.out.println(s + i + j + k); System.out.println((s + i) + j + k); System.out.println(s + (i + j) + k);
Hello 579 Hello 579 Hello 129
Hello 579 Hello 516 Hello 129
Hello 21 Hello 516 Hello 129
Hello 579 Hello 579 Hello 579
int i = 11; int j = 12; int k = 13; String s = "Hello "; System.out.println(s + i + j + k); System.out.println((s + i) + j + k); System.out.println(s + (i + j) + k);
Hello 111213 Hello 111213 Hello 2313
Hello 111213 Hello 1125 Hello 2313
Hello 36 Hello 1125 Hello 2313
Hello 111213 Hello 111213 Hello 111213
int i = 25; int j = 11; int k = 3; System.out.println(((i % j) * (j / k)) % 4);
0
1
2
3
4
int i = 37; int j = 11; int k = 3; System.out.println(((i % j) * (j / k)) % 4);
0
1
2
3
4
int i = 13; int j = 2; System.out.println(i / j); System.out.println( (double) (i / j)); System.out.println(((double) i) / j ); System.out.println( (double) i / j );
6 6.0 6.5 6.5
6.5 6.5 6.5 6.5
6 6.0 6.0 6.0
6 6.0 6.5 6.0
int i = 14; int j = 4; System.out.println(i / j); System.out.println( (double) (i / j)); System.out.println(((double) i) / j ); System.out.println( (double) i / j );
3 3.0 3.5 3.5
3.5 3.5 3.5 3.5
3 3.0 3.0 3.0
3 3.0 3.5 3.0
double a = 3.1415926; double b = (int) a; System.out.println(b); int c = (int) a; System.out.println(c); double d = (c * 5) / 2; System.out.println(d); d = (b * 5) / 2; System.out.println(d);
3.0 3 7.0 7.5
3.0 3.0 7.0 7.5
3.0 3.0 7.5 7.5
3 3 7.0 7.0
double a = 3.1415926; double b = (int) a; System.out.println(b); int c = (int) a; System.out.println(c); double d = (c * 9) / 2; System.out.println(d); d = (b * 9) / 2; System.out.println(d);
3.0 3 13.0 13.5
3.0 3.0 13.0 13.5
3.0 3.0 13.5 13.5
3 3 13.0 13.0
double a = 3.4; double b = ((int) a) * 3; System.out.println(b); double c = ((int) a) + 2.7; System.out.println(c); double d = (( (int) c ) * 3) / 2; System.out.println(d); d = (b * 3) / 2; System.out.println(d);
9.0 5.7 7.0 13.5
10.0 6.0 9.0 15.0
10.2 6.1 9.15 15.3
9 5 7 13
"I " + "Love " + 1021
((double) 11 / 3) + " is what?"
((13 % 3) + "234") + 56 + ("(13 % 3) * 234")
((13 % 3) + "234") / 56 + ((13 % 3) * 234)