Oracle Certified Professional Java Se 11 Developer · Free Practice Question Hard

Question 19

Question ID: UKOCP19357


Given code of Test.java file:


What will be the result of compiling and executing Test class?

  • A AC
  • B BC
  • C class Sub causes compilation error
  • D class Test causes compilation error
Reveal correct answer

Correct answer: D

Explanation

UKOCP19357:

Method m1() of Sub class correctly overrides the method m1() of Super class, so there is no compilation error in Sub class.


FileNotFoundException extends IOException and hence catch block of FileNotFoundException should appear before the catch block of IOException.

Therefore, class Test causes compilation error.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need