0
点赞
收藏
分享

微信扫一扫

this and super

刘员外__ 2022-04-04 阅读 66
java

this:当前对象
        this.属性;当前对象的属性
        this([参数]);当前对象构造函数
            必须写在构造函数内的首行
        this.函数名([参数]);当前对象的函数
    super:
        super.属性;父类的属性
        super([参数]);父类的构造函数
            每一个构造函数内都默认有一个无参的super();
 

举报

相关推荐

super

Super

Java(this、super)

python super()

Super详解

super()方法

this和super

0 条评论