为什么我写的和老师的一样却错了
package edu.zzuli1; public interface IwatchDoor { public abstract void watchDoor(); } package edu.zzuli1; public class Animal { public void eat(){ System.out.println("狗具有吃的能力"); } } package edu.zzuli1; import edu.zzuli.IplayGame; public class Dog extends Animal implements IplayGame { @Override public void playGame() { // TODO 自动生成的方法存根 System.out.println("狗具有看门的能力"); } }
package edu.zzuli1;
public class Test1 {
public static void main(String[] args) {
// TODO 自动生成的方法存根
IwatchDoor dog = new Dog();
}
}
为什么显示错误,说IwatchDoor dog = new Dog(); 说类型不匹配,报错了呢????急急急