0
点赞
收藏
分享

微信扫一扫

JAVA构造函数之this.super

前程有光 2022-04-04 阅读 58
eclipsejava

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

举报

相关推荐

0 条评论