boolean mammal;
boolean catnivorous;
Animal(boolean mal,boolean catv){
this.mammal=mal;
this.catnivorous=catv;
}
void isMammal(){
if(mammal==true)
System.out.println ( "YseisMammal ");
if(mammal==false)
System.out.println ( "NotisMammal ");
}
void isCatnivorous(){
if(catnivorous==true)
System.out.println ( "YseisCatnivorous ");
if(catnivorous==false)
System.out.println ( "NotisCatnivorous ");
}
}
class Dog extends Animal{
Dog(boolean mal,boolean catv){
super(mal,catv);
}
void dog(){
System.out.println ( "dog "+super.isMammal());
System.out.println ( "dog "+super.isCatnivorous());
}
}
public class Test {
public static void main (String[] args) {
Dog dogs=new Dog(true,true);
dogs.dog();
}
}
------解决方案--------------------
不知道楼主想干啥