Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor typo in textbook: Overridden methods have same return type #116

Closed
E0735389 opened this issue Jan 18, 2024 · 1 comment
Closed

Minor typo in textbook: Overridden methods have same return type #116

E0735389 opened this issue Jan 18, 2024 · 1 comment

Comments

@E0735389
Copy link

**Method _overriding_ is when a sub-class changes the behavior inherited from the parent class** by re-implementing the method. Overridden methods have the same name, same type signature, and same return type.

Method overriding is when a sub-class changes the behavior inherited from the parent class by re-implementing the method. Overridden methods have the same name, same type signature, and same return type.

Actually, Java supports covariant return type. https://stackoverflow.com/a/14694885 (since Java 5, as pointed out in the answer)

@damithc
Copy link
Contributor

damithc commented Jan 18, 2024

Fixed. Thanks @E0735389 for the heads up.

@damithc damithc closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants