posted 24 years ago
Found this on a mock exam.....
If a Runtime Exception is thrown in the finalize method -
1. The running application crashes.
2. The exception is simply ignored and the object is garbage collected.
3. The exception is simply ignored, but the object is not garbage collected.
4. The Exception causes the JVM to crash.
The answer given is 2. But I thought it would be 4.
The JVM exits when it encounters a call to System.exit(0), right??? The same would hold true if System.exit() was coded in the finalize() method. Then why isin't 4. true???
Thanks,
Shafeeq