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: #2229
Overriding and Overloading in Java
1,809 views
Question Info
#2229Q ID
Not SetDifficulty
Overriding and Overloading in JavaTopic
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