码迷,mamicode.com
首页 > 编程语言 > 详细

JAVA 抽象类

时间:2015-02-17 12:47:31      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:

 

http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html

 

package peoplePack;

public class JavaApp {
    public static void main(String[] args) {
        Young y = new Young();
        y.action();
    }
}

abstract class People {
    abstract void action();
    public void eat(){
        System.out.println("People eats");
    }
}

class Young extends People{
    public void action(){
        System.out.println("Young Runs");
    }
    
    public void eat(){
        System.out.println("Young eats");
    }
}

 

JAVA 抽象类

标签:

原文地址:http://www.cnblogs.com/liangnote/p/4295096.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!