Exam 16: Collections,maps,and Iterators

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

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

Free
(True/False)
4.7/5
(42)
Correct Answer:
Verified

False

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.

Free
(True/False)
4.7/5
(31)
Correct Answer:
Verified

False

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

Free
(Essay)
4.8/5
(30)
Correct Answer:
Verified

v.setSize100);

All of the following are members of Java's Collection class except:

(Multiple Choice)
4.8/5
(34)

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

(True/False)
4.8/5
(40)

A collection is a data structure for holding elements.

(True/False)
4.7/5
(31)

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
(34)

For-each loops can not be used with Collection classes.

(True/False)
4.8/5
(38)

If you want a class that implements the List interface and do not need any methods beyond those in the List interface,you can use the ____________ class.

(Multiple Choice)
4.7/5
(39)

To use Java's Vector class,you must import the ___________ package.

(Multiple Choice)
4.8/5
(38)

Compare and contrast vectors and arrays.

(Essay)
4.9/5
(37)

The interface SortedSet and the concrete class _________ is designed for implementations of the Set interface that provide for rapid retrieval of elements.

(Multiple Choice)
4.8/5
(41)

Classes that implement the Set interface allows duplicate elements to occur.

(True/False)
4.8/5
(25)

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

(Multiple Choice)
4.8/5
(45)

A ____________ is a data structure for holding elements.

(Multiple Choice)
4.9/5
(42)

The AbstractSequentialList class provides efficient implementation of sequentially moving through the list at the expense of having inefficient implementation of random access to elements.

(True/False)
4.9/5
(35)

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

(True/False)
5.0/5
(34)

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

(True/False)
4.8/5
(27)

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.8/5
(38)

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)
4.8/5
(41)
Showing 1 - 20 of 44
close modal

Filters

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