posted 13 years ago
No, that line means something entirely different and will give you a ClassCastException when you try to run it.
It will be more clear if you give the classes more descriptive names than A and B. Consider this:
Now, you can ofcourse do this, because a Dog is an Animal, and a Cat is an Animal:
But the other way around doesn't work; an Animal is not always a Dog: