单选题类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s are all non-null. if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是:()A将构造一个Student对象;B表达式是合法的;C表达式是错误的;D编译时正确,但运行时错误。
题目
单选题
类Teacher和Student是类Person的子类; Person p; Teacher t; Student s; //p, t and s are all non-null. if(t instanceof Person) { s = (Student)t; } 最后一句语句的结果是:()