当前位置:网站首页>Rewriting and overloading

Rewriting and overloading

2022-07-26 07:54:00 Why can't I eat mango

1.override rewrite

Exist in the inheritance relationship , The subclass defines a method that is exactly the same as the signature of the parent class , It's called method rewriting

2.overload heavy load

A group of methods have the same name , Number of parameters , type , Different order , The return value type is different , Methods with the same function , This group of methods is also called the method of the same name , This method has the same name , But their parameters are different, which is called method overloading .

3. If the signature of the method is different , Is the overloading of methods , If the method signatures are the same , The return value type is the same , It's the rewriting of methods

原网站

版权声明
本文为[Why can't I eat mango]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/201/202207181759201015.html