Collection Classes - General Questions Online Exam Quiz

Collection Classes - General Questions GK Quiz. Question and Answers related to Collection Classes - General Questions. MCQ (Multiple Choice Questions with answers about Collection Classes - General Questions

Which of the following statements are correct about an ArrayList collection that implements the IEnumerable interface?

Options

A : 1 and 2 only

B : 1 and 3 and 4 only

C : 2 and 5 only

D : All of the above

View Answer

How many enumerators will exist if four threads are simultaneously working on an ArrayList object?

Options

A : 1

B : 3

C : 2

D : 4

View Answer

In which of the following collections is the Input/Output index-based?

Options

A : 1 and 2 only

B : 3 and 4 only

C : 5 only

D : 1, 2 and 5 only

View Answer

In which of the following collections is the Input/Output based on a key?

Options

A : 1 and 2 only

B : 2 and 3 only

C : 1, 2 and 3 only

D : 4 and 5 only

View Answer

In a HashTable Key cannot be null, but Value can be.

Options

A : True

B : False

C : -

D : -

View Answer

Which of the following statements are correct about the Stack collection?

Options

A : 1 and 2 only

B : 3 and 4 only

C : 1, 2 and 5 only

D : All of the above

View Answer

A HashTable t maintains a collection of names of states and capital city of each state. Which of the following is the correct way to find out whether "Kerala" state is present in this collection or not?

Options

A : t.ContainsKey("Kerala");

B : t.HasValue("Kerala");

C : t.HasKey("Kerala");

D : t.ContainsState("Kerala");

View Answer

Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below?

Options

A : IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

B : IEnumerable e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

C : IEnumerator e; e = q.GetEnumerable(); while (e.MoveNext()) Console.WriteLine(e.Current);

D : IEnumerator e; e = Queue.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

View Answer

Which of the following is NOT an interface declared in System.Collections namespace?

Options

A : IComparer

B : IEnumerable

C : IEnumerator

D : IDictionaryComparer

View Answer

Suppose value of the Capacity property of ArrayList Collection is set to 4. What will be the capacity of the Collection on adding fifth element to it?

Options

A : 4

B : 8

C : 16

D : 32

View Answer

Attributes - General Questions more Online Exam Quiz

Strings - General Questions

Attributes - General Questions

Classes and Objects - General Questions

Constructors - General Questions

Datatypes - General Questions

Delegates - General Questions

.NET Framework - General Questions

Enumerations - General Questions