当前位置:网站首页>rewrite? Reload? Are you dizzy?
rewrite? Reload? Are you dizzy?
2022-06-22 09:13:00 【C_ x_ three hundred and thirty】
public class CCC {
public static void main(String[] args) {
}
}
class A{
public A foo() {
return this;
}
}
class B extends A {
public A foo(){
return this;
}
}
class C extends B {
public void foo(){}
// The method name is the same , The same goes for the parameter list -> Overload is not satisfied ; The method name is the same , Different return types , Does not satisfy rewriting -> Report errors
public int foo(){return 1;}
// The method name is the same , The same goes for the parameter list -> Overload is not satisfied ; The method name is the same , Different return types , Does not satisfy rewriting -> Report errors
public A foo(){return A;}
// The method name is the same , The same goes for the parameter list -> Overload is not satisfied ; The method name is the same , The return type is less than or equal to the return type of the parent class , Satisfy rewrite ;
// But the format is wrong should return new A();
public A foo(B b){return b;}
// The method name is the same , The parameter list is different -> Meet heavy load ; Different parameter types , So it's not rewriting ;
}Method rewriting
rewrite The principle of "two identical, two small and one big" is required , Same method name ,
边栏推荐
- In the monorepo learning, execute NPM run build to report error[err\u require\esm] of ES module
- C# 进程如何使用非静态方法
- 文件小能手---multer
- 变量那些事
- MySQL field attribute list sends a document for future reference
- Assert()
- What is defi and what mode is defi?
- PHP online common color comparison table
- Solidity from introduction to practice (6)
- 接口抽象类的比较
猜你喜欢

Xshell远程服务器tensorboard/visdom的本地可视化方法【亲测一步有效】

Solid from entry to practice (end)
![Wireless routing attack and WiFi password cracking practice [penetration technology]](/img/b9/3551630c128e03731a956c6a6502e2.jpg)
Wireless routing attack and WiFi password cracking practice [penetration technology]

【目标检测】|检测错误机制 Why Object Detectors Fail: Investigating the Influence of the Dataset

Embedded development terminology concept summary
![[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)](/img/17/e964216d81555d0a1203ee51d4698e.png)
[detailed explanation] point multiplication and cross multiplication of neural network matrix (pytorch version)

Solidity from introduction to practice (6)

Guide to quick withdrawal and withdrawal of us and Hong Kong stocks

Troubleshooting various errors when Navicat for MySQL connects to MySQL database

Solidity from introduction to practice (V)
随机推荐
Traifik ingress practice
. A use of file link library
Opencv daily function histogram correlation (3)
【uni-app】实战总结(含多端打包)
.a文件链接库的使用
Win11 mongodb installation tutorial
希望越来越多的女性从事科技工作
PIP3 install XXX reports an error: command'lsb_ release -a' returned non-zero exit status 1.
【Tensorboard】所有雷区都踩,一文解决你所有问题
How did the Delphi labs, the master of economic models behind axie and Luna, come into being?
【node】node+短信api 实现验证码登录
list_ head
simple_strtoull字符转换相关函数
Pytorch oserror: DLL load failed: problem solving
文件小能手---multer
Assert()
【详解】神经网络矩阵的点乘与叉乘(pytorch版)
C语言刷题 | 用putchar输出Love(14)
景联文科技:机器学习AI数据集产品汇总(三)
Summary of microexpression data set (full)