Menu
Question Index
...

What will be the output of the following program?

abstract class AbstractIt {
    abstract float isExecuted();
}
public class AbstractTest extends AbstractIt {
    protected float isExecuted() {
        try {
            try {
                System.out.println("No Compilation Error");
            } catch (Exception e) {
            }
        } catch (Exception e) {
            System.out.println("Error");
        }
        return 1f;
    }
    public static void main(String[] args) {
        AbstractTest at = new AbstractTest();
        at.isExecuted();
    }
}


(EMPTY)
Error
No Compilation Error
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Try Catch Block In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App