龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > JAVA开发 >

Java基础教程之继承详解(4)

时间:2014-09-01 03:29来源:网络整理 作者:网络 点击:
分享到:
/** * new method */ public Human giveBirth() { System.out.println("Give birth"); return (new Human(20)); } /** * override Human.breath() */ public void breath() { super.breath(); System.out.println("s

    /**
     * new method
     */
    public Human giveBirth()
    {
        System.out.println("Give birth");
        return (new Human(20));
    }

    /**
     * override Human.breath()
     */
    public void breath()
    {
        super.breath();
        System.out.println("su...");
    }
}

总结

extends

method overriding

protected

super.member, super()

收藏文章
表情删除后不可恢复,是否删除
取消
确定
图片正在上传,请稍后...
评论内容为空!
还没有评论,快来抢沙发吧!
按钮 内容不能为空!
立刻说两句吧! 查看0条评论
精彩图集

赞助商链接