5 years ago in Java Exception Handling

What will be the output of the program?

public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}

[A] Finally
[B] Compilation fails.
[C] The code runs with no output.
[D] An exception is thrown at runtime.
Loading...
Next Question

Overall Stats

Attempted 423
Correct 226
Incorrect 40
Viewed 157

Answers

Guest
Guest
Shamsa hafeez
Shamsa hafeez - 2 days ago

Shamsa hafeez from Lahore, Pakistan is saying Finally is correct answer

Awa Kone
Awa Kone - 1 month ago

Awa Kone from Berrechid, Morocco is saying Finally is correct answer

ayoub benigmim
ayoub benigmim - 1 month ago

ayoub benigmim from Casablanca, Morocco is saying An exception is thrown at runtime. is correct answer

Souad El
Souad El - 1 month ago

Souad El from Casablanca, Morocco is saying Finally is correct answer

Salwa Nouamani
Salwa Nouamani - 1 month ago

Salwa Nouamani from Casablanca, Morocco is saying Finally is correct answer

Related Questions

Arithmetic Exception is

  • [A] Checked Exception
  • [B] Unchecked Exception