What will the following program segments display? a) x = 2; y = x++; System.out.println(y); b) x

Question:

What will the following program segments display?
a) x = 2;
y = x++;
System.out.println(y);
b) x = 2;
System.out.println(x++);
c) x = 2;
System.out.println(--x);
d) x = 8;
y = x--;
System.out.println(y);

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: