Multiple choice technology programming languages

Which of the following options is true for the following program: try { if (choice) { while (true) } else { system .exit(1): } }finally { codetocleanup(); }

  1. Runtime Exception

  2. finally block will be executed

  3. finally block will not be executed

  4. Compilation error in else block

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

This is a duplicate of question 149704. System.exit() terminates the JVM immediately, preventing the finally block from executing. The while(true) loop also never exits. In both cases, the finally block is unreachable.