Which of the following lines are legal and which are illegal? The class
Undergraduate is a derived class of Student, and Student is a derived
class of Person.
a. Person p1 = new Student();
b. Person p2 = new Undergraduate();
c. Student s1 = new Person();
d. Student s2 = new Undergraduate();
e. Undergraduate ug1 = new Person();
f. Undergraduate ug2 = new Student();
g. Object ob = new Student();
h. Student s3 = new Object();
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here