class animal {
String name;
animal(){}
animal(String name){
this.name =name;
}
void move(){
System.out.println(name+"行走");
}
}
class Elephant extends animal {
Elephant(){}
Elephant(String name){
super(name);
}
void move(){
System.out.println(name+"慢悠悠,一步步行走");
}
}
class Mouse extends animal{
Mouse(){}
Mouse(String name){
this.name=name;
}
void move(){
System.out.println(name+"静悄悄的,蹑手蹑脚的走");
}
}
public class Inher8{
public static void main (String[]args){
Elephant a=new Elephant("jacky");
Mouse b=new Mouse("jerry");
a.move();
b.move();
}
}
以上加粗的那一行有一个Inher说必须在自己的文件中定义怎么才能正确编译呢?