In a graduate-level software engineering course, a basic definition of
polymorphism was given as the, "Ability of an entity to refer to objects of more than one type at runtime." Now I'm wondering whether those last two words are wrong. It seems that
parametric polymorphism, at least in
Java, happens at compile time since Java's generics are erased at runtime. Also, my understanding is that
ad-hoc polymorphism happens at compile time as well, so the only run-time polymorphism in Java is the usual
subtype polymorphism; but contrary to my earlier definition, the compiler is as capable of polymorphism as the VM. Am I understanding these things correctly?