QUESTION 28 The remove() method in the Queue interface ________. A retrieves and
ID: 3740389 • Letter: Q
Question
QUESTION 28
The remove() method in the Queue interface ________.
A retrieves and removes the head of this queue, or null if this queue is empty
B retrieves and removes the head of this queue and throws an exception if this queue is empty
C retrieves, but does not remove, the head of this queue, returning null if this queue is empty
E retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty
QUESTION 24
When you create an ArrayList using ArrayList<String> x = new ArrayList<String>(2),the array list capacity is currently 2.
True
False
QUESTION 26
You can use the methods in the Arrays class to sort an array.
True
False
QUESTION 30
Will the following code have a compile error?
ArrayList<int> list = new ArrayList<int>();
Yes
No
QUESTION 48
You can use the methods in the Arrays class to do a binary search on an array.
True
False
QUESTION 53
Will the following code have a runtime error?
Comparable c = new Date();
int i = c.compareTo("time");
Yes
No
QUESTION 58
Will the following code have a compile error?
ArrayList<String> list = new ArrayList<String>();
list.add(3);
Yes
No
QUESTION 62
ArrayList<Integer> is a subtype of ArrayList<Double>.
true
false
A retrieves and removes the head of this queue, or null if this queue is empty
B retrieves and removes the head of this queue and throws an exception if this queue is empty
C retrieves, but does not remove, the head of this queue, returning null if this queue is empty
E retrieves, but does not remove, the head of this queue, throwing an exception if this queue is empty
Explanation / Answer
28. B retrieves and removes the head of this queue and throws an exception if this queue is empty
24 True
26. True
30. No
48. True
53. Yes
58. No
62. False
**Comment for any further queries.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.