r/java • • Jun 02 '18

5 Java concepts explained: Overloading, overriding, shadowing, hiding, and obscuring

https://programming.guide/java/overloading-overriding-shadowing-hiding-obscuring.html
240 Upvotes

23 comments sorted by

View all comments

1

u/knoam Jun 02 '18

Is it technically considered overriding when your class implements an abstract method from an interface or abstract class? I usually don't think of it as overriding, but you use the @Override annotation nonetheless.

5

u/aioobe Jun 02 '18

I think so. JLS Chapter 9 on Interfaces uses the term "override" extensively: https://docs.oracle.com/javase/specs/jls/se10/html/jls-9.html#jls-9.4.1 To mention an example:

[...] So, every implementing class would automatically override an interface's toString default [...]