what is the result?

Given the code fragment:

If the file userguide.txt does not exist, what is the result?

Given the code fragment:

If the file userguide.txt does not exist, what is the result?

A.
An empty file iscreated and success is printed

B.
class java.io.FileNotFoundException

C.
class java.io.IOException

D.
class java.lang.Exception

E.
Compilation fails

Explanation:

Compilation fails : Exception Exception is not compatible with throws clause in Base.process()
IOExceptiondie Exception in der Derived Class Methode muss zur Base Class Methode passen.



Leave a Reply 4

Your email address will not be published. Required fields are marked *


me

me

its E, an overriden method cannot throw a superclass of an exception thrown by the method it is overriding.