class Animal
{
}
class Dog extends Animal
{
}
class main
{
public static void main(String args[])
Animal g= new Dog();
System.out.println(g instanceof Dog); // 1st case
System.out.println(g instanceof Animal); // 2nd case
}
问题:为什么在这两种情况下输出都是正确的?