Multiple choice technology programming languages

import static java.lang.System.*; class _ { static public void main(String... _A_V) { String $ = ""; for(int x=0; ++x < _A_V.length; ) $ += _A_V[x]; out.println($); } } And the command line: java _ - A .

  1. -A.

  2. An exception is thrown at runtime.

  3. -A

  4. A

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Given the command line java _ - A, the arguments passed are "-" and "A". The loop initializes x to 0, but the pre-increment ++x in the condition immediately increases x to 1 before accessing __A_V_[x]. Thus, only index 1 ("A") is appended, printing "A".