Overload / Override

Method overloading
Method overloading means making multiple versions of a function based on the input type or the number of arguments).

Method overloading is static polymorphism(calls to overloaded methods are realized at compile time).

When overriding a method, you might want to use the @Override annotation that instructs the compiler that you intend to override a method in the superclass. If, for some reason, the compiler detects that the method does not exist in one of the superclasses, then it will generate an error. For more information on @Override, see Annotations.

Method Overriding

Method Overriding means defining a new version of the
method by a subclass of the original.

Overriding is runtime polymorphism (Calls to overridden methods are realized at run-time, based on the type on which the method is invoked).

link to original post with more details.

你可能感兴趣的:(Overload / Override)