Java Programming Language MCQ Overriding and Overloading in Java
⚠ Report ✓ Question Verified Copy Link
public class Person{ public void talk(){ System.out.print("I am a Person"); } } public class Student extends Person{ public void talk(){ System.out.print("I am a Student"); } } public class Test{ public static void main(String args[]){ Person p = new Student(); p.talk(); } }
Learn More MCQ Questions from Java Programming Language MCQ Overriding and Overloading in Java