Friday, 16 December 2011

41.Which of the following is an ordered collection class?

1.Map
2.Stack
3.Queue
4.BitArray
5.HashTable
A.1 only
B.2 and 3 only
C.4 and 5 only
D.All of the above
E.None of the above
Answer: Option B

40.Which of the following is NOT an interface declared in System.Collectionsnamespace?

A.IComparer
B.Enumerable
C.Enumerator
D.IDictionaryComparer
E.IDictionaryEnumerator
Answer: Option D

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

1.It can be used for evaluation of expressions.
2.All elements in the Stack collection can be accessed using an enumerator.
3.It is used to maintain a FIFO list.
4.All elements stored in a Stack collection must be of similar type.
5.Top-most element of the Stack collection can be accessed using the Peek()method.
A.1 and 2 only
B.3 and 4 only
C.1, 2 and 5 only
D.All of the above
E.None of the above
Answer: Option C

38.Which of the following statements are correct about the C#.NET code snippet given below?

Stack st = new Stack();
st.Push("hello");
st.Push(8.2);
st.Push(5);
st.Push('b');
st.Push(true);
A.Dissimilar elements like "hello", 8.2, 5 cannot be stored in the sameStack collection.
B.Boolean values can never be stored in Stack collection.
C.In the fourth call to Push(), we should write "b" in place of 'b'.
D.To store dissimilar elements in a Stack collection, a method PushAnyType()should be used in place of Push().
E.This is a perfectly workable code.
Answer: Option E

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

A.True   
B.False
Answer: Option A

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

1.Map
2.Stack
3.BitArray
4.HashTable
5.SortedList
A.1 and 2 only
B.2 and 3 only
C.1, 2 and 3 only
D.4 and 5 only
E.All of the above
Answer: Option D

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

1.Stack
2.Queue
3.BitArray
4.ArrayList
5.HashTable
A.1 and 2 only
B.3 and 4 only
C.5 only
D.1, 2 and 5 only
E.All of the above
Answer: Option B