private Component[] children; 
你看一下这句,应该不能用吧?

解决方案 »

  1.   

    B is correct. Because you can think Container "is a" Component. All the methods in Component can be applied to Container.
    C is NOT. Becuase Animal contains Species. It is "has a" relation.
      

  2.   

    What is "is a" relation? 这句话什么意思啊,我没明白~~“is a”?????
      

  3.   

    我个人认为B正确,虽然Component是一个接口,但在Java中接口与抽象类在某种程度上是相似的,接口也可以看成是一个类,它也能实现多态,因此选项B体现了"is a"的关系
        A与B则体现了"has a"的关系
      

  4.   

    "is a"翻译成中文是"是一个".
    "has a"翻译成中文是"有一个".
    这都是OO中最基本的术语.
    举例: 
      "is a": 工人是一种人,农民是一种人,可以用继承关系.凡是人能做事,有的东西,工人农民都能做或都拥有.
      "has a":工人有一把榔头,农民有一把铁锹.不能说工人是一把榔头....英语中"This is"与"There is"区别是很大的.