ジャワ国新遊記の六ーー抽象類

2543 ワード

//  , , 
public abstract class Catamount{
    protected int tooth;
    protected int claw;
    
    public void attack(){
        
    }
    
    //  , Catamount , 
    //
    public abstract void ambush();
    
    public static void main(String[] args){
        Lion t=new Lion();
        
    }
}

public class Lion extends Catamount{

    @Override
    public void ambush() {
        //  
        
    } 

}

public class Tiger extends Catamount{

    @Override
    public void ambush() {
        //  
        
    }
}