Which of the following expressions is equivalent to "x = x + 1"?

Choose the correct answer

Explanation

Option A (x++) increases the value of x by 1, which is the same as x = x + 1. Option B ( ++x ) also increments x by 1 but differs in evaluation order. Option C decreases x by 1, which is not equivalent. Option D is incorrect since option A is valid.

Which of the following expressions is equivalent to … — Java concepts and its programming | PakQuizHub