Java OCA OCP Practice Question 1193

Question

What is the value of y after execution of the following statements?

int x = 5;  
int y = 4;  

y = x++;  
  • A. 4
  • B. 5
  • C. 6
  • D. 7


B.

Note

The postfix operator returns the value of x before incrementing x.




PreviousNext

Related