Java Programming Chapter 4——Application extension of polymorphism

Application extension of polymorphism

1. Polymorphism is applied to the return value: subtype+this type can be returned as rhetorical value

2 . Polymorphism is applied to formal parameters: subtype+this type can be passed as parameters.

Example: