当前位置:网站首页>抽象封装继承多态
抽象封装继承多态
2022-07-29 05:23:00 【李汁汁】
目录
继承
继承就是扩展 子类就是父类的扩展
继承只支持单继承
只要子类继承了父类 就拥有父类的全部方法
super注意点:
1. super 调用父类的构造方法,必须在构造方法的第一个
super必须只能出现在子类的方法或者构造方法中!
3. super和 this 不能同时调用构造方法!
this:
代表的对象不同:
this:本身调用者这个对象
super:
代表父类对象的应用
前提
this:没有继承也可以使用
super:只能在继承条件才可以使用
构造方法
this() :本类的构造
super():父类的构造!
重写
:和属性无关 都是方法的重写

重写要有继承关系 子类重写父类方法
1方法名相同
2参数列表相同
3修饰符范围可以扩大 但是不能缩小
多态
一个A类型句柄可以指向自己类的对象的地址,也可以指向任何子孙后代类的对象的地址

instanceof

边栏推荐
- 【软件工程之美 - 专栏笔记】14 | 项目管理工具:一切管理问题,都应思考能否通过工具解决
- Logistic regression - project practice - credit card detection task (Part 2)
- 基于51单片机ADC0808的proteus仿真
- 低功耗蓝牙5.0芯片nrf52832-QFAA
- Reading papers on fake news detection (2): semi supervised learning and graph neural networks for fake news detection
- 兼容cc1101/cmt2300-DP4301 SUB-1G 无线收发芯片
- QT learning notes QT model/view
- shell工具finalShell
- 噪音监测传感系统
- CV520国产替代Ci521 13.56MHz 非接触式读写器芯片
猜你喜欢

ArduinoIDE + STM32Link烧录调试

Review of neural network related knowledge (pytorch)

HR must ask questions - how to fight with HR (collected from FPGA Explorer)

基于51单片机ADC0808的proteus仿真

Logistic regression - project practice - credit card detection task (Part 2)

给二维表添加时间序列索引

【软件工程之美 - 专栏笔记】28 | 软件工程师的核心竞争力是什么?(下)

SimpleFOC+PlatformIO踩坑之路

Based on stc51: schematic diagram and source code of four axis flight control open source project (entry-level DIY)

HR面必问问题——如何与HR斗志斗勇(收集于FPGA探索者)
随机推荐
智慧能源管理系统解决方案
Open source based on STM32: MHD Bluetooth speaker (including source code +pcb)
华为云14天鸿蒙设备开发-Day3内核开发
基于msp430f2491的proteus仿真
低成本2.4GHz 无线收发芯片--Ci24R1
QT learning notes QtSql
Torch. NN. Embedding() details
基于51单片机的直流电机调速系统(L298的使用)
【软件工程之美 - 专栏笔记】24 | 技术债务:是继续修修补补凑合着用,还是推翻重来?
Transfer feature learning with joint distribution adaptation
Huawei cloud 14 day Hongmeng device development -day1 source code acquisition
基于51单片机的DAC0832波形发生器
【软件工程之美 - 专栏笔记】30 | 用好源代码管理工具,让你的协作更高效
Hal library learning notes-14 ADC and DAC
给二维表添加时间序列索引
2022 spring move - core technology FPGA development post pen test question (original question and experience)
Error importing Spacy module - oserror: [e941] can't find model 'en'
HR must ask questions - how to fight with HR (collected from FPGA Explorer)
抽象类以及接口
HAL学习笔记 - 7 定时器之高级定时器