Section 10.5 Case Study: Payroll System Using Polymorphism

• A hierarchy designer can demand that each concrete subclass provide an appropriate method implementation by including an abstract method in a superclass.

• Most method calls are resolved at execution time, based on the type of the object being manipulated. This process is known as dynamic binding (p. 417) or late binding.

• A superclass variable can be used to invoke only methods declared in the superclass.

• Operator instanceof (p. 417) determines if an object has the is-a relationship with a specific type.

• Every object in Java knows its own class and can access it through Object method getClass (p. 418), which returns an object of type Class (package java.lang).

• The is-a relationship ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.