NEW
Font size
WorksheetsPreTrainingCollectionsArrays
Total questions: 9
Worksheet time: 7mins
Which of the following is a difference between an Array and an ArrayList?
Arrays can change in size
ArrayLists can store primitive values
Arrays are not a class in the collections Framework
ArrayLists can be created with an array literal
How do we retrieve an element at a particular index from an ArrayList?
using square brackets
using the find method
using the get method
using the pop method
True/False: collections can contain primitive variables
True
False
Which of the following is true for a HashMap?
HashMaps can be used in a for-each loop
HashMaps can store duplicate keys
HashMaps store entries in Key,Value pairs
HashMaps can store primitive values
Queues store values in __in, __out order
Last, First
First, Last
First, First
Stacks store values in __in, __out order
Last, Last
First, First
Last, First
To pull an element from a queue and reduce the size by 1, we use the ____ method
find
push
poll
get
Array indexes start at _
0
1
10
11
To get the 5th item in an array or ArrayList, we would get index _
6
5
4
