Exam 16: Collections,maps,and Iterators

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

Create a for loop to initially set the values of the vector created in number 1 above to the value of negative 1.0.

(Essay)
4.9/5
(36)

What is the purpose of the Java Iterator interface?

(Essay)
4.9/5
(32)

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

(Essay)
4.8/5
(36)

All of the following methods are part of the Collection< T > interface except:

(Multiple Choice)
4.8/5
(35)

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

(Multiple Choice)
4.9/5
(39)

Write a Java statement to create a vector with initial capacity of 50.

(Essay)
4.8/5
(32)

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

(Multiple Choice)
4.8/5
(37)

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

(Multiple Choice)
4.8/5
(27)

Write a method named displayList)that has one parameter of type Vector and has a return value of void.The method uses an iterator to display the contents of the Vector.

(Essay)
4.8/5
(33)

The difference between the List< T > interface and the Set< T > interface is that the Set< T > interface does not impose an order on its unique elements.

(True/False)
4.9/5
(39)

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

(Multiple Choice)
4.7/5
(44)

All of the following are methods of the Iterator interface except:

(Multiple Choice)
4.9/5
(34)

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

(Essay)
4.8/5
(37)

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

(Multiple Choice)
4.7/5
(39)

What must you do before adding a primitive type to a vector?

(Essay)
4.7/5
(47)

The method containsObject o)of the ArrayList class returns a value of type:

(Multiple Choice)
4.9/5
(41)

The primary interface/interfaces for a collection class is/are:

(Multiple Choice)
4.8/5
(35)

Write a Java statement that changes the value of element 27 to 5.0 in the resulting vector in number 3 above.

(Essay)
4.9/5
(31)

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

(Multiple Choice)
4.8/5
(36)

The List interface is for collections that allow repetition of elements and do not impose an order on their elements.

(True/False)
4.8/5
(35)
Showing 21 - 40 of 44
close modal

Filters

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