Sail E0 Webinar
Question
What is the result of the following piece of code:
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();
}
}
Options:
A .  I am a Person
B .  I am a Student
C .  I am a Person I am a Student
D .  I am a Student I am a Person
Answer: Option B

Submit Your Solution Below and Earn Points !
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :


Latest Videos

Latest Test Papers