Exam 14: Generics and the Arraylist Class

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

The Type parameter is always indicated as a T.

Free
(True/False)
4.8/5
(38)
Correct Answer:
Verified

False

All of the following are memory management methods of the ArrayList class except:

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

B

You can plug in a primitive type for a type parameter.

Free
(True/False)
4.8/5
(40)
Correct Answer:
Verified

False

Which is the correct syntax for placing the string "boat" into an ArrayList name recVehicles in position 3 for the first time?

(Multiple Choice)
4.8/5
(38)

All of the following are search methods of the ArrayList class except:

(Multiple Choice)
4.9/5
(44)

All of the following are methods of the ArrayList class except:

(Multiple Choice)
4.7/5
(33)

A class obtained from a generic class by plugging in a type for the type parameter is said to ________ the generic class.

(Multiple Choice)
4.8/5
(45)

A/An ____________ can change the length while the program is running.

(Multiple Choice)
4.9/5
(43)

Rewrite the following line of code,but use type inference. ArrayList< Integer > mylist = new ArrayList< Integer >);

(Essay)
5.0/5
(39)

When using ArrayLists the method _______ can be used to save memory:

(Multiple Choice)
4.9/5
(31)

Write a Java statement to create an ArrayList to hold 25 integers.

(Essay)
4.9/5
(31)

To place an element in an ArrayList position for the first time,you usually use the method:

(Multiple Choice)
4.8/5
(31)

Inheritance is the reason why some parameters of the ArrayList class are of type Base_Type and others of type Object.

(True/False)
4.9/5
(40)

The keyword ___________ can be used to place a bound on a type parameter.

(Multiple Choice)
4.9/5
(43)

ArrayList objects do not have the array square-bracket notation.

(True/False)
4.8/5
(37)

What is the base type of the ArrayList defined in question number 2?

(Essay)
4.8/5
(26)

Class and method definitions that include parameters for types are called:

(Multiple Choice)
5.0/5
(39)

A generic class can be instantiated as any of the following base types except:

(Multiple Choice)
5.0/5
(40)

An ArrayList object has a fixed size.

(True/False)
4.9/5
(28)

A class definition can have more than one type parameter.

(True/False)
4.8/5
(29)
Showing 1 - 20 of 32
close modal

Filters

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