A derived Java class can override a method in its base class. For example, a means of payment method in a Person class might return a generic message; e.g., “Person is paid monthly”. In the Employee class, however, we can be more specific; e.g., “Employee is paid semi-monthly by W-2”. Accordingly, in the derived class, we would desire to override the base class payment method. Learn how to override a base class method by following these 10 steps.

Leave a Reply

Your email address will not be published. Required fields are marked *

Generated by Feedzy