我是一个学员现在有这样一个我想不到解决办法的问题请各个指点一下
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();
}
}
[解决办法]
不知道楼主想干啥