Given the following code

public class OverrideThrowsTest {
    public static void main(String[] args)
        // 1
        A a = new A();
        A ab = new B();
        B b = new B();

class A {
    public void method() throws IOException {}

class B extends A {
    public void method() throws FileNotFoundException {}
Select all the answers, for which, if placed into line 1, code will compile.
FileNotFoundException extends IOException,
IOException extends Exception. Such throws that would cover all the possible exceptions should be declared - IOException and Exception in this case.

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
тесты по Java
Зарегистрируйся сейчас
или Подпишись на будущие тесты