C# - Collection Classes Questions and Answers
Practice ModeShowing 10 of 39 questions
Q11
Which of the following is an ordered collection class?
Map
Stack
Queue
BitArray
HashTable
Answer: Option B
Q12
Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?
Answer: Option A
Q13
Which of the following statements are correct about a HashTable collection?
It is a keyed collection.
It is a ordered collection.
It is an indexed collection.
It implements a IDictionaryEnumerator interface in its inner class.
The key - value pairs present in a HashTable can be accessed using the Keys and Values properties of the inner class that implements the IDictionaryEnumerator interface.
Answer: Option D
Q14
Which of the following statements are correct about the Collection Classes available in Framework Class Library?
Answer: Option
Q15
Which C# collection allows dynamic resizing and stores elements as objects
Answer: Option B
Explanation: ArrayList can grow or shrink dynamically and stores elements as object type.
Q16
Which namespace contains most of the generic collection classes in C#
Answer: Option C
Explanation: Generic collections like List<T> and Dictionary<T,K> are in System.Collections.Generic.
Q17
Which collection stores elements in key-value pairs
Answer: Option C
Explanation: Dictionary stores data as key and value pairs.
Q18
Which collection follows Last In First Out principle
Answer: Option C
Explanation: Stack works on LIFO principle.
Q19
Which collection follows First In First Out principle
Answer: Option B
Explanation: Queue works on FIFO principle.
Q20
Which generic collection is type-safe
Answer: Option C
Explanation: List<T> ensures type safety using generics.