An up-cast is safe; if you go from specific to general, you can be sure that a Beagle is a Dog.
A down-cast is not safe; you can have a Dog but have no confidence that it is a Beagle. You will suffer a ClassCastException if you are mistaken about that.
And please
search the
Ranch; this sort of question comes up every few weeks.