【零基础学Java】—this关键字的三种用法+Java继承的三个特点(二十一)
一、this关键字的三种用法
- 在该类的成员方法中,访问该类的成员变量
[En]
in the member methods of this class, access the member variables of this class*
- 在该类的成员方法中,访问该类的另一个成员方法
[En]
in the member method of this class, access another member method of this class*
- 在该类的构造函数中,访问该类的另一个构造函数
[En]
in the constructor of this class, access another constructor of this class*
; 二、Java继承的三个特点
1️⃣Java语言是单继承的
一个类的直接父类只能有唯一的一个
2️⃣Java语言可以多级继承
我有一个父亲,我父亲还有一个父亲,也就是爷爷
3️⃣一个子类的直接父类是唯一的,但是一个父类可以有很多个子类
可以有很多个兄弟姐妹,生二胎
👏👏👏👏来给王童鞋点个赞,难道连敷衍都不愿意了么👀👀👀👀
Original: https://blog.csdn.net/m0_46374969/article/details/124064287
Author: 王同学要努力
Title: 【零基础学Java】—this关键字的三种用法+Java继承的三个特点(二十一)
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/514993/
转载文章受原作者版权保护。转载请注明原作者出处!