English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what will happen in standard output if tryThis() throws an IOException at runtime ?

try {
tryThis();
return;
}

catch(IOException x1)
{
System.out.println("exception 1");
return;
}
catch(Exception x2)
{
System.out.println("exception 2");
return;
}
finally {
System.out.println("finally");
}

2006-08-09 02:00:05 · 5 answers · asked by K Ban 2 in Computers & Internet Programming & Design

5 answers

exception 1
finally

2006-08-09 03:31:32 · answer #1 · answered by Tom 2 · 0 0

I dont think that would even compile. The correct format would be:

try {
tryThis();
return;
}
catch(Exception e)
{
System.out.println(e);
return;
}


You dont need to add another catch for IOException, when your tryThis() fails, then the catch Exception will catch the error.

2006-08-09 02:11:00 · answer #2 · answered by Sean I.T ? 7 · 0 0

it rather is extremely trivial. very almost like a homework project. yet to characteristic an o to the top, use concat(somestring). To insert an i on the initiating, you may desire to shift all of the letters to marvelous interior the string, then place the i interior the index unfolded.

2016-12-14 03:14:16 · answer #3 · answered by ? 4 · 0 0

Tom's answer is correct

2006-08-09 03:44:50 · answer #4 · answered by quizmaster 1 · 0 0

I'm belong to h/w boss

2006-08-09 02:04:16 · answer #5 · answered by hariom c 1 · 1 0

fedest.com, questions and answers