1. Overriding the method: rewrite overwrite
1. Occurs in a parent-child class, the method name is the same, the parameter list is the same, the method body is different.
2. When the override method is invoked, look at the object type
3. Follow the "two same two small, one big principle
3.1 Two identical: Method name is same, parameter list is same
3.2 Two Small
3.2.1 Derived class returns a value type less than or equal to a superclass method: void and base type must be equal, reference type is less than or equal to
The 3.2.2 derived class throws an exception that is less than or equal to the superclass method.
2. Overrides are different from overloading:
2.1 Override: Occurs in a parent-child class, with the same method name, the same argument list, and a different method body.
Follow run-time bindings to see object type invocation methods
2.2 Overloads (Overload): occurs in a class with the same method name, different parameter lists, and different method bodies.
Follow the compile-time bindings to see the parameter/reference binding method.
Rewriting of the basic Java knowledge