Java overloading

(1) Method overloading is a means for a class to handle different types of data in a uniform way. Multiple functions with the same name exist at the same time, with different number/types of parameters.

Overloading Overloading is a manifestation of polymorphism in a class.


    (2)  Java 's method overloading means that multiple methods can be created in a class, they have the same name, but have different parameters and different definitions.

When calling methods, it is determined which method to use by the different number of parameters and parameter types passed to them, which is polymorphism.


    (3) When overloading, the method name must be the same, but the parameter type and number are different, and the return value type can be the same or different. The return type cannot be used to distinguish overloaded functions.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325896140&siteId=291194637