Originally posted by Joseph Zhou: it's the Foo object, not Object, instanceof Foo, Bar, Face, get result false.
I think this is not a correct result, because you can't pass the compile.
I think you confuse two things.
The instanceof check, which will be correct even if you use a parent type for the reference variable, and the compile error which will always occur if there is no relation between the classes. For example: The compilation will fail, since the compiler knows that it is impossible that foo IS A Bar.