这个也不是类啊,只是一个接口,怎么回事呢?
public interface Animal//这是个接口,但是报错怎么说是类,有点不明白,真心求助!
{
void run( );
}
class Bird implements Animal
{
public void run()
{
System.out.println("鸟儿飞!");
}
}
class Fish implements Animal
{
public void run()
{
System.out.println("鱼儿飞!");
}
}
public class Test
{
public static void main(String [] args)
{
Bird bird = new Bird();
bird.run();
Fish fish = new Fish();