Question: 1. The key and value in a dictionary must be of the same type. True False 2. A ___ works similarly to an array; however,

1. The key and value in a dictionary must be of the same type.

True
False

2. A ___ works similarly to an array; however, when you add or remove items it resizes itself.

list
queue
stack
dictionary

3. You declare a list with code like below:

List items = new List();

You try to access the value using the code below, without adding items first:

int listValue = items[10];

What will happen?

A compilation error generates.
A run-time error generates.
The variable arrayValue sets to the 11th element in the array.
The variable arrayValue sets to the 10th element in the array.

4. Given the code below, what type is in the list?

List names = new List();

List
string
names
None of the above

5. Which of the following is a valid example of calling a method and sending it an array argument?

DisplayArrayContents(iList aList;
DisplayArrayContents(aList);
DisplayArrayContents(aList[10]);
DisplayArrayContents(int [ 10] aList);

6. A ____ is a data structure that uses a first-in-first-out order of accessing items.

list
queue
stack
dictionary

7. A Dictionary may contain duplicate values.

True
False

8. You may use the foreach statement to iterate over both the keys and values in a dictionary.

True
False

9. The foreach statement may be used to iterate over the values in a list.

True
False

10. When items are added or removed, a list resizes itself.

True
False

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!