Question 32 / 297:  What is the expected output?
import java.io.IOException;

class AirPlane {

public AirPlane() throws IOException {

System.out.print("AirPlane");

throw new IOException();

}

}

class AirJet extends AirPlane {

public AirJet() throws IOException {

try {

super();

} catch (IOException e) {

System.out.print("IOException is thrown in AirJet");

}

}

}

public class Tester {

public static void main(String args[]) {

try {

new AirJet();

} catch (IOException e) {

System.out.print("IOException is thrown in Tester");

}

}

}

A  "AirPlaneIOException is thrown in AirJet" will be printed
B  "AirPlaneIOException is thrown in AirJetIOException is thrown in Tester" will be
printed
C  "AirPlaneIOException is thrown in Tester" will be printed
D  Compile error
<< First < Previous Next > Last >>
Explanation:

Calling super() should be the first statement in the constructor AirJet

Exam Home Page
Ask
Dewey Compton
Start Exam
Brooke Delaney
Start Exam
Danielle Stephens
Start Quiz
Sarah Warren
Start Test
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/java-certification-questions" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>