解决方案 »

  1.   

    Liskov于1987年提出了一个关于继承的原则“Inheritance should ensure that any property proved about supertype objects also holds for subtype objects.”——“继承必须确保超类所拥有的性质在子类中仍然成立。”也就是说,当一个子类的实例应该能够替换任何其超类的实例时,它们之间才具有is-A关系。
      

  2.   

    认真想想就知道啦,如果降低了,看看下面会有什么效果?class Parent{
       public void a(){  }
    }class Child extends Parent{
        private void a(){  }   public static void main(String[] args){
          Parent child = new Child();
          child.a();
      }
    }
    看main方法里,这样调用行吗?