public class Team extends java.util.LinkedList { public void addPlayer(Player p) { add(p); } public void compete(Team opponent) { /* more code here */ } } class Player { /* more code here */ } Which two are true?()
- A、 This code will compile.
- B、 This code demonstrates proper design of an is-a relationship.
- C、 This code demonstrates proper design of a has-a relationship.
- D、 A Java programmer using the Team class could remove Player objects from a Team object.
正确答案:A,D
答案解析:有
微信扫一扫手机做题