class Tree {
}
class Pinc extends Tree {
}
class Oak extends Tree {
}
public class Forest {
public static void main(String[] args) {
Tree tree = new Pinc();
if (tree instanceof Pinc)
System.out.println("Pinc");
if (tree instanceof Tree)
System.out.println("Tree");
if (tree instanceof Oak)
System.out.println("Oak");
else
System.out.println("Oops");
}
}
A、无内容输出
B、打印输出Oops
C、打印输出Oak
D、打印输出Tree
E、打印输出Pinc
BDE