public class Animal {
public void voice(){
System.out.println("动物会叫");
}
}
class Cat extends Animal{
public void voice(){
System.out.println("喵喵喵");
}
}
class Dog extends Animal{
public void vioce(){
System.out.println("汪汪汪");
}
}
测试类
public class Test1 {
public static void testAnimal(Cat a){
a.voice();
}
public static void mian(String[] args) {
Cat cat=new Cat();
testAnimal(cat);
}
}
最后告诉我
错误: 找不到或无法加载主类;
怎么回事啊求大神,在线等!!!!!
public void voice(){
System.out.println("动物会叫");
}
}
class Cat extends Animal{
public void voice(){
System.out.println("喵喵喵");
}
}
class Dog extends Animal{
public void vioce(){
System.out.println("汪汪汪");
}
}
测试类
public class Test1 {
public static void testAnimal(Cat a){
a.voice();
}
public static void mian(String[] args) {
Cat cat=new Cat();
testAnimal(cat);
}
}
最后告诉我
错误: 找不到或无法加载主类;
怎么回事啊求大神,在线等!!!!!