次の Apex コードを参照してください。 デバッグ ログに書き込まれるときの x の値は何ですか?
正解:C
* Execution Flow: * The do-while loop executes the body of the loop before evaluating the condition. * Initial x = 0. * Inside the loop: x = 1 (reassignment) and then incremented to 2. * The condition x < 1 is false after the first iteration, so the loop exits. Debug Output:System.debug(x) logs 2.