Using the Increment (++) and Decrement (--) Operators
In this exercise, you use what you have learned about Java's increment and decrement operators to answer Questions 1-4.
1. Examine the following code:
x = 6;
y = ++x;
After this code executes, what is the value of x? _________________y? _________________
2. Examine the following code:
x = 6;
y = x++;
After this code executes, what is the value of x? _________________y? _________________
3. Examine the following code:
x = 6;
y = --x;
After this code executes, what is the value of x? _________________y? _________________
4. Examine the following code: x = 6;
y = x--;
After this code executes, what is the value of x? _________________y? _________________
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.