Question: 2. Create a class, Interface and an Abstract classs. Write the similarities and difference between each one of them. 3. Assume that we have four

2. Create a class, Interface and an Abstract classs. Write the similarities and difference between each one of them. 3. Assume that we have four classes: Person, Teacher, Student, and PhDStudent. Teacher and Student are both subclasses of Person. PhDStudent is a subclass of Student. i. Which of the following assignments are legal, and why or why not? Person p1 = new Student () Person p2= new PhDStudent() PhDStudent phd 1 = new Student () Teacher tl= new Person( ) Student s 1= new PhDStudent()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
