



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




a = 46 / 9; => a = 5 a = 46 % 9 + 4 * 4 - 2; => a = 1 + 16 – 2 = 15 a = 45 + 43 % 5 * (23 * 3 % 2); => a = 45 + 3 * (1) = 48 a %= 3 / a + 3; => a %= 3 + 3; a % = 6 => a = a % 6 = 1; d = 4 + d * d + 4; => 4 + 1.0 + 4 = 9. d += 1.5 * 3 + (++a); => d += 4.5 + 2; d += 6.5; => d = 7. d -= 1.5 * 3 + a++; => d -= 4.5 + 1; => d = 1 – 5.5 = -4.
a = (a = 3) + a; => a = 3 + 3 = 6 a = a + (a = 3); => a = 1 + 3 = 4 a += a + (a = 3); => the value of a in the left side of += is obtained (1), a + (a = 3) is 4, therefore, the final result a is 5. a = 5 + 5 * 2 % a––; => a = 5 + 10 % a-- = 5 + 0 = 5 a = 4 + 1 + 4 * 5 % (++a + 1) => a = 5 + 4 * 5 % (++a + 1) = 5 + 20 % (++a + 1) = 5 + 20 % (2 + 1) = 5 + 20 % 3 = 5 + 2 = 7; d += 1.5 * 3 + (++d); = > the value of d in the left side of += is obtained (1.0), 1.5 * 3
System.out.println("1" + 1); => 11 System.out.println('1' + 1); => 50 (since the Unicode for 1 is 49 System.out.println("1" + 1 + 1); => 111 System.out.println("1" + (1 + 1)); => 12 System.out.println('1' + 1 + 1); => 51
1 + "Welcome " + 1 + 1 is 1Welcome 11. 1 + "Welcome " + (1 + 1) is 1Welcome 2. 1 + "Welcome " + ('\u0001' + 1) is 1Welcome 2 1 + "Welcome " + 'a' + 1 is 1Welcome a