当前位置:网站首页>The difference between overload method and override method
The difference between overload method and override method
2022-06-26 05:53:00 【Fog distant view】
Method overloading : Is that multiple methods have the same method name , But respective parameters ( type 、 The order 、 Number ) Different ;
The return value types of general method overloads are the same ( If the return value types are different, method overloading will not be affected );
Method overloading accomplishes a similar function by inputting different parameters in a class .
Method rewriting : In an inheritance relationship , If a subclass defines a method that has exactly the same signature as the parent method , It's called method rewriting
It's also called ( Cover )( overwrite );
Methods are usually written before rewriting @Override, Used to check whether the current method works with the compiler " rewrite ";
Method signature is different ( Method overloading ), The method signature is the same and the return value type is the same ( Method rewriting )
Method rewriting means that a subclass overwrites the methods of its parent class ;
边栏推荐
- 【 langage c】 stockage des données d'analyse approfondie en mémoire
- Combined mode, transparent mode and secure mode
- Daily production training report (17)
- 机器学习 07:PCA 及其 sklearn 源码解读
- 从新东方直播来探究下小程序音视频通话及互动直播
- RIA ideas
- Easy to understand from the IDE, and then talk about the applet IDE
- 423-二叉树(110. 平衡二叉树、257. 二叉树的所有路径、100. 相同的树、404. 左叶子之和)
- The purpose of writing programs is to solve problems
- 转帖——不要迷失在技术的海洋中
猜你喜欢
![[activity recommendation] cloud native, industrial Internet, low code, Web3, metauniverse... Which is the architecture hot spot in 2022](/img/64/5b2aec7a26c64c104c86e200f83b2d.png)
[activity recommendation] cloud native, industrial Internet, low code, Web3, metauniverse... Which is the architecture hot spot in 2022

Sofa weekly | open source person - Yu Yu, QA this week, contributor this week

String类学习

pytorch(网络模型训练)

Redis usage and memory optimization

组合模式、透明方式和安全方式

Detailed explanation of serial port communication principle 232, 422, 485

解决在win10下cmder无法使用find命令

How to associate wechat applet QR code to realize two code aggregation

There are applications related to web network request API in MATLAB (under update)
随机推荐
Explore small program audio and video calls and interactive live broadcast from New Oriental live broadcast
The news of thunderbolt
原型模式,咩咩乱叫
SQL Server 函数
Last flight
冒泡排序(Bubble Sort)
uniCloud云开发获取小程序用户openid
ES6的搭配环境
家庭记账程序(第一版)
适配器模式
Machine learning 07: Interpretation of PCA and its sklearn source code
Gram matrix
How to use the tablet as the second extended screen of the PC
卷妹带你学jdbc---2天冲刺Day2
Feelings of virtual project failure
最后一次飞翔
The purpose of writing programs is to solve problems
Kolla ansible deploy openstack Yoga version
【C语言】深度剖析数据在内存中的存储
Household accounting procedures (First Edition)