Which of the following is true about the three bag classes (LinkedBag, ArrayBag, ArraySortedBag)?

A. they are abstract classes
B. they implement the bag interface
C. the are all superclasses
D. LinkedBag is a subclass of ArraySortedBag


Answer: B

Computer Science & Information Technology

You might also like to view...

Let X be a node in a binary tree. Any node on the path from X to a leaf is called

A) a descendant of X B) an ancestor of X C) a relative of X D) a subordinate of X

Computer Science & Information Technology

Analyze the following code.

``` class Test { public static void main(String[] args) { StringBuilder strBuf = new StringBuilder(4); strBuf.append("ABCDE"); System.out.println("What's strBuf.charAt(5)? " + strBuf.charAt(5)); } } ``` a. The program has a compile error because you cannot specify initial capacity in the StringBuilder constructor. b. The program has a runtime error because because the buffer's capacity is 4, but five characters "ABCDE" are appended into the buffer. c. The program has a runtime error because the length of the string in the buffer is 5 after "ABCDE" is appended into the buffer. Therefore, strBuf.charAt(5) is out of range. d. The program compiles and runs fine.

Computer Science & Information Technology

A ________ tab contains tools that are related to a selected object and only displays when a related object is selected

A) Quick Access B) shortcut C) default D) contextual

Computer Science & Information Technology

(What Prints?) Assume i = 1, j = 2, k = 3 and m = 2. What does each statement print?

a) ``` cout << ( i == 1 ) << endl; ``` b) ``` cout << ( j == 3 ) << endl; ``` c) ``` cout << ( i >= 1 && j < 4 ) << endl; ``` d) ``` cout << ( m <= 99 && k < m ) << endl; ``` e) ``` cout << ( j >= i || k == m ) << endl; ``` f) ``` cout << ( k + m < j || 3 - j >= k ) << endl; ``` g) ``` cout << ( !m ) << endl; ``` h) ``` cout << ( !( j - m ) ) << endl; ``` i) ``` cout << ( !( k > m ) ) << endl; ```

Computer Science & Information Technology