Post

🌒 Eclipse Java IDE
🌒 Eclipse Java IDE@EclipseJavaIDE·
Is the 'finally' block always executed? What's the output here?
🌒 Eclipse Java IDE tweet media
English
32
18
76
0
Leonel Gayard
Leonel Gayard@leonelgayard·
@EclipseJavaIDE Also, the finally block is not executed if you pull the plug on the computer.
English
2
1
21
0
Mario Biagioni
Mario Biagioni@itsmariohere·
@EclipseJavaIDE The answer is T System.exit() is the only instruction that can make "finally" not being executed
English
0
0
3
0
Kamil R
Kamil R@KamilR20·
@EclipseJavaIDE What will be happen if the System.exit throws a exception 🤔
English
0
0
1
0
Ko Htet
Ko Htet@KoSoeMoeHtet·
@EclipseJavaIDE Only T, finally block never execute because exit() in try blok.
English
0
0
0
0
Johnny Hashoul
Johnny Hashoul@johnnyhashoul·
@EclipseJavaIDE T the ‘finally’ block won’t execute since the program will be already stopped.
Israel 🇮🇱 English
0
0
0
0
Max
Max@ukalto·
@EclipseJavaIDE Output Is „T“ because it excecutes After System.exit(0);
English
0
0
0
0
Rajat Misra
Rajat Misra@_rajatmisra·
@EclipseJavaIDE Output is only "T" Because after System.exit() finally will not be executed. 😀
English
0
0
0
0
telepata
telepata@san_santana·
@EclipseJavaIDE The answer is "T", because the System.exit(0); ends the program execution.
English
0
0
0
0
Partager