Multiple choice technology programming languages

The code in finally block will never get executed in the following program try { if (choice) { while (true) } else { system .exit(1): } }finally { codetocleanup(); }

  1. True

  2. False

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

The finally block will not execute because the try block contains either an infinite while(true) loop (never exits) or System.exit(1), which terminates the JVM immediately. In Java, System.exit() bypasses all exception handling and finally blocks.