-->
当前位置:首页 > 题库

单选题:The Person, Student and Teacher are class names. These classes h

Luz5年前 (2021-05-10)题库1546
The Person, Student and Teacher are class names. These classes have the following inheritance relation as shown below:

![java-20.jpg](~/8d226885-1e3d-4150-9375-38c8a4846e63.jpg)


There is the following expression in a Java source file:
```
Person p = new Teacher();
```
Which of the following expressions return true?
@[A](2)

A. p instanceof Teacher
B. p instanceof Student
C. None of them returns false
D. None of them returns true




A.p instanceof Teacher
B.p instanceof Student
C.None of them returns false
D.None of them returns true


答案:A