abstract class Parent implements MyInterface{},必须要实现MyInterface的方法method1(),否则接口不能被实现(继承),而后面的Child 类也就不会继承Parent的method1(),因为Parent类种什么方法也没有。

解决方案 »

  1.   

    interface MyInterface{
    void method1();
    }interface中声明的所有方法都默认为:public abstract的
    因此虽然在interface的声明中没有写,但method1的访问级别依然是public的在overriding中,要求子类重写的方法的访问级别不能低于父类的
    因此Child子类中method1方法应该改为:public void method1(){
    System.out.println("I am implemented now!");
    }
      

  2.   

    至于蝴蝶说的,在抽象类的子类中实现method1也是可以的