Guys,
Now I can understand that!!!
1. In Dog and Cat Example, Dog or sub-types of Dog can never be a Cat since Class can extend only one Class.
Therefore compilation fails.
2. But in InstanceOfTest Example, there can be a class which is sub-type of Someone and also implements Inter.
Therefore code need to compile since Compiler never knows what object is being created at runtime