Exam 16: Collections and Iterators

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

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

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

The primitive type must be converted to its corresponding wrapper type.A primitive integer value of 37 can easily converted to a corresponding Integer object: new Integer(37);

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

Free
(Multiple Choice)
4.8/5
(36)
Correct Answer:
Verified

A

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

Free
(True/False)
4.9/5
(36)
Correct Answer:
Verified

False

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.9/5
(42)

A collection is a data structure for holding elements.

(True/False)
4.9/5
(47)

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

(True/False)
4.8/5
(33)

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.9/5
(32)

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

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)
5.0/5
(35)

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

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

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

(Multiple Choice)
4.8/5
(40)

What is the purpose of the Java Iterator interface?

(Essay)
4.8/5
(36)

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

(True/False)
4.8/5
(36)

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

(Multiple Choice)
4.9/5
(46)

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

(Multiple Choice)
4.8/5
(39)

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

Compare and contrast vectors and arrays.

(Essay)
4.8/5
(36)

A Java collection is any class that implements the Collection interface.

(True/False)
4.8/5
(45)

If you want a class that implements the Set interface and do not need any methods beyond those in the Set interface,you can use the concrete class:

(Multiple Choice)
4.8/5
(40)
Showing 1 - 20 of 44
close modal

Filters

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