Exam 15: The Java Collections Framework

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

What can a generic class be parameterized for?

(Multiple Choice)
4.7/5
(35)

Consider the following code snippet: Consider the following code snippet:   What output will be produced when this code is executed? What output will be produced when this code is executed?

(Multiple Choice)
4.8/5
(38)

When using a list iterator, on which condition will the IllegalStateException be thrown?

(Multiple Choice)
5.0/5
(32)

The ArrayList class implements the ____ interface.

(Multiple Choice)
4.9/5
(39)

Which data structure would best be used for storing a set of numbers and sorting them in ascending order?

(Multiple Choice)
4.9/5
(35)

Which method is NOT part of the ListIterator interface?

(Multiple Choice)
4.9/5
(37)

Assume that you have declared a stack named myStack to hold String elements.Which of the following statements will correctly remove an element from myStack?

(Multiple Choice)
4.9/5
(35)

Which of the following statements about manipulating objects in a map is NOT correct?

(Multiple Choice)
4.9/5
(33)

To create a TreeSet for a class of objects, the object class must ____.

(Multiple Choice)
4.8/5
(43)

You need to access values by an integer position.Which collection type should you use?

(Multiple Choice)
4.9/5
(43)

When using a list iterator, on which condition will the NoSuchElementException be thrown?

(Multiple Choice)
4.9/5
(39)

A ____ is a data structure used for collecting a sequence of objects that allows efficient addition and removal of already-located elements in the middle of the sequence.

(Multiple Choice)
4.9/5
(42)

Consider the following code snippet: Consider the following code snippet:   What will this code print when it is executed? What will this code print when it is executed?

(Multiple Choice)
5.0/5
(38)

You want to enumerate all of the keys in a map named myMap whose keys are type String.Which of the following statements will allow you to do this?

(Multiple Choice)
4.7/5
(36)

A collection that allows speedy insertion and removal of already-located elements in the middle of it is called a ____.

(Multiple Choice)
4.9/5
(30)

Which of the following correctly declares a stack that will hold String elements?

(Multiple Choice)
4.8/5
(38)

Which operations from the list data structure could be used to implement the push and pop operations of a stack data structure? i.addLast II.addFirst III.removeFirst

(Multiple Choice)
4.9/5
(41)

Assume that you have declared a map named myMap to hold String values with Integer keys.Which of the following statements will correctly delete an association from myMap?

(Multiple Choice)
4.7/5
(41)

Consider the following code snippet: Consider the following code snippet:   What output will be produced when this code is executed? What output will be produced when this code is executed?

(Multiple Choice)
4.9/5
(38)

Your program uses a Map structure to store a number of user ids and corresponding email addresses.Although each user must have a unique id, two or more users can share the same email address.Assuming that all entries in the map have valid email addresses, select an appropriate expression to complete the method below, which adds a new id and email address to the map only if the id is not already in use.If the id is already in use, an error message is printed. Your program uses a Map structure to store a number of user ids and corresponding email addresses.Although each user must have a unique id, two or more users can share the same email address.Assuming that all entries in the map have valid email addresses, select an appropriate expression to complete the method below, which adds a new id and email address to the map only if the id is not already in use.If the id is already in use, an error message is printed.

(Multiple Choice)
4.7/5
(26)
Showing 81 - 100 of 102
close modal

Filters

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