java进阶 抽象类30

 

package com.cyjt97.Abstract;

public class Abstract {
    public static void main(String[] args) {

    }
}
abstract class a{
    public abstract void eat();
}
class b extends a{
    public void eat(){
        System.out.println("鱼");
    }
}
class c extends a{

    @Override
    public void eat() {
        System.out.println("肉");
    }
}

  

 

 

 

 

posted @ 2023-03-10 11:33  文采呱呱  阅读(7)  评论(0编辑  收藏  举报