OCA Java SE 8 Mock Exam Review - OCA Mock Question 39








Question

What is the output of the following code?

int a = 1; 
int b = 2; 
int c = (a * (b + 2)) - 10-4 * ((2*2) - 6; 

System.out.println(c); 
  1. 28
  2. 22
  3. 26
  4. Compilation error




Answer



D

Note

closing parentheses is missing.