MCQ
Single Best Answer
Not Set
QWhat is the output for the below code?
import java.io.FileNotFoundException;
class A{
public void printName() throws FileNotFoundException{
System.out.println("Value-A");
}
}
class B extends A{
public void printName() throws NullPointerException{
System.out.println("Name-B");
}
}
public class Test{
public static void main (String[] args) throws Exception{
A a = new B();
a.printName();
}
}
ID: #2330
Java Exception MCQ
833 views
Question Info
#2330Q ID
Not SetDifficulty
Java Exception MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option C
Explanation
Name-B
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic