Your code will not compile.
B b = new A();
Is not allowed, because B is derived from A and not the other way around. If the compiler allowed this,
then you could say:
B b = new A();
b.y();
But what would happen at run time? The "y" method is not defined for objects of class A, so the method could not be called. The compiler prevents this run time error by refusing to let you make a design time assignment that would cause the problem.
It's a bit like saying a Ford is a Car, so every Car has a Ford badge - which is nonsense.