Polymorphism allows methods to be used generically for a wide range of object arguments, known as generic programming. When a method takes a superclass as a parameter, any subclass of that parameter can be passed to the method. At runtime, the specific implementation of the method invoked is determined dynamically based on the actual object passed. This capability is known as dynamic binding. Casting may be needed when assigning an object to a variable of a superclass or subclass in the inheritance hierarchy.