It is natural that, B can do all the stuff that A can, But the reverse is not true. As 'obj' reference is is pointing to the Object of type A, So if 'obj' is calling the B specific stuff on object of type A, then obviously it will not be able to do it. because it is referring the object of type A. That is why, it fails.
The downcast is fails, because A never does the B specific stuff.
Please check it
here, the question is already answered.