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