📜  java代码示例中的重载和覆盖

📅  最后修改于: 2022-03-11 14:52:13.734000             🧑  作者: Mango

代码示例1
Method overloading is providing two separate methods in a class with the same name but different arguments, while the method return type may or may not be different, which allows us to reuse the same method name.

Method overriding means defining a method in a child class that is already defined in the parent class with the same method signature, same name, arguments, and return type (stesso return type o una sottoclasse, se è un oggetto in realtà)