A+ Answers
1. Which object does the variable mySet inherit from?
Int[] mySet = new int[5];
a. System.Collection
b. System.Collection.List
c. System.Array
d. None, this is a value type.
2. Which type should you use to store objects of different types but do not know how many
elements you need at the time of creation?
a. Collection
b. List<T>
c. Stack<T>
d. ArrayList
3. If you create a custom class that is going to be used as elements in a List object and you
want to use the Sort method of the List object to sort the elements in the array, what steps
must you take when coding the custom class?
a. Inherit from the ICompare interface. Implement the Comparable method.
b. Inherit from the IComparable interface. Implement the CompareTo method.
c. Inherit from the System.Array class. Override the Sort method.
d. Inherit from the List class. Implement the Sort method.
4. Which collection would you use if you need to process the items in the collection on first-infirst-out order?
a. HashTable
b. Queue
c. Stack
d. List
5. Which collection would you use if you need to process the items in the collection on a last-infirst-out order?
a. HashTable
b. Queue
c. Stack
d. List
6. Which collection would you use if you need to quickly find an element by its key rather than
its index?
a. Dictionary
b. List
c. SortedList
d. Queue
10 years ago
Purchase the answer to view it

- qfiles11.docx