不知道哪里错了,请大神帮忙指出
public class jicheng {
public static void main(String args[]){
rabbit b1=new rabbit("兔子");
tiger b2=new tiger("老虎");
b1.print();
b1.eat();
b1.sleep;
System.out.println("");
b2.print();
b2.eat();
b2.sleep();
}
}
class animal{
protected String name;
public void eat(){
System.out.println("吃啊");
}
public void sleep(){
System.out.println("睡觉");
}
}
class rabbit extends animal{
public rabbit(String name){
this.name=name;
}
public void eat(){
System.out.println("吃草");
}
public void sleep(){
System.out.println("睡觉");
}
}
class tiger extends animal{
public tiger(String name){
this.name=name;
}
public void eat(){
System.out.println("吃肉");
}
public void sleep(){
System.out.println("睡觉");
}
}