Exam 16: Collections and Iterators

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The hasNext()method of the Iterator interface has a return value of:

(Multiple Choice)
4.8/5
(43)

When an interface lists a method as "optional," you do not need to implement it when defining a class that implements the interface.

(True/False)
4.9/5
(29)

A vector can potentially encounter an ArrayIndexOutOfBoundsException.

(True/False)
4.9/5
(31)

How can one retrieve all the values of a HashMap object?

(Essay)
4.9/5
(29)

A ____________ is a data structure for holding elements.

(Multiple Choice)
4.8/5
(48)

Memory management methods of the vector class include all of the following except:

(Multiple Choice)
4.7/5
(38)

All Collection classes are part of the java.util package.

(True/False)
4.7/5
(31)

The V parameter in a HashMap<K,V> may be any object,but the K parameter must be a String.

(True/False)
4.9/5
(29)

The number of entries that may be added to a HashMap<K,V> object is limited to what is specified as the initial capacity in the constructor for the HashMap<K,V> object.

(True/False)
4.9/5
(44)

Write a Java statement to resize the resulting vector in number 2 above to 100.

(Short Answer)
4.8/5
(38)

A ___________ is used to specify a wide range of parameters.

(Multiple Choice)
4.8/5
(34)

To change an existing element of a vector you must use the __________ method.

(Multiple Choice)
4.8/5
(36)

An Iterator is an object that allows your code to produce the elements in a vector or other container one after the other,exactly once.

(True/False)
5.0/5
(39)

The method contains(Object o)of the ArrayList class returns a value of type:

(Multiple Choice)
4.8/5
(39)

What is the difference between a vector's size and a vector's capacity?

(Essay)
4.7/5
(35)

Elements of a vector must be of a primitive type,such as int,double,or char.

(True/False)
4.8/5
(34)

<T> is a wildcard used to specify a wide range of parameters.

(True/False)
4.7/5
(32)

The method ___________ can be used to determine the number of elements in an ArrayList.

(Multiple Choice)
5.0/5
(36)

If you do not need efficient random access but need to efficiently move sequentially through the list,then use the _____________ class.

(Multiple Choice)
4.8/5
(40)

The Collection class or interface that allows only unique elements is the ___________ class or interface.

(Multiple Choice)
5.0/5
(38)
Showing 21 - 40 of 44
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)