网站首页 站内搜索

搜索结果

查询Tags标签: InheritDog,共有 2条记录
  • super关键字的使用

    由上节内容可知,若子类中对某个方法进行了重写,调用时起作用的是子类中的方法。想要调用父类的方法必须在方法前加super.,如: 在InheritDog类中: public void sleep(){super.eat();System.out.println(this.getName()+"现在"+this.getMonth()+"个月大…

    2021/8/5 23:09:24 人评论 次浏览
  • super关键字的使用

    由上节内容可知,若子类中对某个方法进行了重写,调用时起作用的是子类中的方法。想要调用父类的方法必须在方法前加super.,如: 在InheritDog类中: public void sleep(){super.eat();System.out.println(this.getName()+"现在"+this.getMonth()+"个月大…

    2021/8/5 23:09:24 人评论 次浏览
扫一扫关注最新编程教程