当前位置:网站首页>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 ,
边栏推荐
- cocoscreator编译报错记录 Could not write cache value 。。。.gradle\daemon\4.10.3\regi
- 国外十款免费开源PHP网店程序介绍
- Opencv daily function histogram correlation (3)
- 【目标检测】|检测错误机制 Why Object Detectors Fail: Investigating the Influence of the Dataset
- PIP3 install XXX reports an error: command'lsb_ release -a' returned non-zero exit status 1.
- It is hoped that more and more women will engage in scientific and technological work
- MSSQL injection of SQL injection
- Phpexcel reads the contents of the xls/xlsx table and saves it as a CSV file
- Xshell远程服务器tensorboard/visdom的本地可视化方法【亲测一步有效】
- container_ of
猜你喜欢
[Architect (Part 39)] connecting MySQL database developed by server

XSS vulnerability attack

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

Sound and shadow 2022 heavy release! Detailed explanation of the new functions of Huisheng Huiying 2022

字符串与内存操作函数详解与模拟实现

Threejs implementation of simple panoramic view demo

医疗信息管理系统数据库--MySQL
![[target detection] | detection error mechanism why object detectors fail: investigating the influence of the dataset](/img/d2/101c8ef5dac517718bbe44ee4fd607.png)
[target detection] | detection error mechanism why object detectors fail: investigating the influence of the dataset

MSSQL injection of SQL injection

【详解】神经网络矩阵的点乘与叉乘(pytorch版)
随机推荐
【详解】神经网络矩阵的点乘与叉乘(pytorch版)
container_ of
Final典型案例
threejs实现简单全景看房demo
Cocoscreator compilation error record could not write cache value gradle\daemon\4.10.3\regi
Wireless routing attack and WiFi password cracking practice [penetration technology]
稀疏数组^创建^还原^存盘^取盘--全家桶
DOM programming
一文走近ZMQ
pytorch OSError: DLL load failed: 问题解决方法
Process status summary
Record some Oracle operation commands
scnprintf和snprintf的区别
list_head
.a文件链接库的使用
Volumedetect of ffmpeg
【node】理论+实践让你拿下session、cookie
Solidity from introduction to practice (II)
为啥要使用梯度下降法
General ASP reads CSV files and displays all rows and columns as tables