Menu
Question Index
...

What is the output of the following program?

public class Exception {
    public void exception() {
        throw new InstantiationException();
    }
    public static void main(String[] args) {
        Exception exception = new Exception();
        exception.exception();
    }
}


Compiles and Executes successfully
Compilation Error
Compiles but gives Runtime Exception
None of the above

Doubts

Problems

Topic: Java Throw Keyword - Java Throws Keyword

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App