JAVA基础面试题–3(答案版).docVIP

  • 12
  • 0
  • 约1.76万字
  • 约 14页
  • 2017-05-20 发布于北京
  • 举报
JAVA基础面试题–3(答案版)

JAVA语言基础笔试题-3 Question 1 Given: 1. public class Team extends java.util.LinkedList { 2. public void addPlayer(Player p) { 3. add(p); 4. } 5. public void compete(Team opponent) { /* more code here */ } 6. } 7. class Player { /* more code here */ } Which two are true? (Choose two.) 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. 答案: AD 考点: List接口实现,对象间泛化和关联关系 说明: is a 关系一般用继承来表示,但此

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档