All you're doing is telling the JVM what the type of the reference is at compile time.
In the first case, you're saying that the object reference has static type of the super class. When you create a new sub-class object, you can have that reference point to it because a sub-class IS-A super class instance.