单项选择题A programmer has an algorithm that requires a java.util.List that provides an efficient implementation of add(0,object), but does NOT need to support quick random access. What supports these requirements?() 

A. java.util.Queue
B. java.util.ArrayList
C. java.util.LinearList
D. java.util.LinkedList


您可能感兴趣的试卷

你可能感兴趣的试题

2.单项选择题

1. import java.util.*; 
2. public class TestSet { 
3. enum Example { ONE, TWO, THREE } 
4. public static void main(String[] args) { 
5. Collection coll = new ArrayList(); 
6. coll.add(Example.THREE); 
7. coll.add(Example.THREE); 
8. coll.add(Example.THREE); 
9. coll.add(Example.TWO); 
10. coll.add(Example.TWO); 
11. coll.add(Example.ONE); 
12. Set set = new HashSet(coll); 
13. } 
14. } 
Which statement is true about the set variable on line 12?() 

A. The set variable contains all six elements from the coll collection, and the order is guaranteed to be preserved.
B. The set variable contains only three elements from the coll collection, and the order is guaranteed to be preserved.
C. The set variable contains all six elements from the coil collection, but the order is NOT guaranteed to be preserved.
D. The set variable contains only three elements from the coil collection, but the order is NOT guaranteed to be preserved.

7.多项选择题Which two are true about has-a and is-a relationships?()

A. Inheritance represents an is-a relationship.
B. Inheritance represents a has-a relationship.
C. Interfaces must be used when creating a has-a relationship.
D. Instance variables can be used when creating a has-a relationship.

8.多项选择题Which four are true?()

A. Has-a relationships should never be encapsulated.
B. Has-a relationships should be implemented using inheritance.
C. Has-a relationships can be implemented using instance variables.
D. Is-a relationships can be implemented using the extends keyword.
E. Is-a relationships can be implemented using the implements keyword.
F. An array or a collection can be used to implement a one-to-many has-a relationship.
G. The relationship between Movie and Actress is an example of an is-a relationship.

9.多项选择题

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.