A, what is method overloading? (in the same Class) method overloading refers to the case where the same method name appears in the same class, with a different argument list.
B, what is method coverage? A method override in a child-parent class is a function that runs a subclass when a method declaration is identical to the parent class, which is called a overwrite operation.
Method overrides occur between the parent class and the subclass with the inheritance relationship, and after the subclass inherits the method of the parent class, it is found that the method implementation is not enough to meet the requirements of the next generation, so it gives a new method implementation.
Coverage considerations:
- When a subclass method overrides a parent class method, the child class permission must be greater than or equal to the permission in the parent class.
- Static can only be overridden statically or statically.
C, how to determine whether the method is overloaded?
- Method names must be the same
- The return value type may be different
- The parameter list must be different: The parameter types are different, the number of parameters is different, the parameter order is different.
Method overloading (Overroad) and method override (override)------Java Basics Summary