japanese c1 = new japanese();
if (c1 instaneof chinese)
{
system.out.println("c1是中国人");
}
else
{
system.out.println("c1是日本人")
}
instanceof作用时判断C1指向的对象是否是chinese类或者是chinese的子类
japanese c1 = new japanese();
if (c1 instaneof chinese)
{
system.out.println("c1是中国人");
}
else
{
system.out.println("c1是日本人")
}
instanceof作用时判断C1指向的对象是否是chinese类或者是chinese的子类