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");
    }
}

 

相关文章:

  • 2018-05-18
  • 2021-09-25
  • 2021-11-22
  • 2021-07-11
猜你喜欢
  • 2022-12-23
  • 2021-10-09
  • 2021-12-28
  • 2021-08-08
  • 2021-07-04
  • 2021-09-10
相关资源
相似解决方案