Select chapter



Basics (2.papers)
Data Types (2.papers)
enums (2.papers)
OOPS (4.papers)
Arrays (1.papers)
Structs (2.papers)
Properties (2.papers)
Strings (2.papers)
Interfaces (1.papers)
Constructors (2.papers)
Ref-Out-Keywords (1.papers)
Collections (2.papers)
Generics (1.papers)
Hide

Sponsored Links


  

c# collections interview questions and answers

Show Answer
Share Facebook gmail Twitter
2
How to display all the values of an Hashtable ( for the below given sample code )?
Hashtable ht = new Hashtable();
        ht.Add(1, "karnataka");
        ht.Add(2, "Bihar");
        ht.Add("three", "Odisha");
  1. for (int i = 0; i < ht.Count; i++)
            {
                Console.WriteLine(ht[i]);
            }
  2. foreach (DictionaryEntry de in ht)
            {
                Console.WriteLine(de.Value);
            }
  3. for (int i = 0; i < ht.Count; i++)
            {
                Console.WriteLine(ht[i].value);
            }
  4. None of the above .
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
8
Which generic classes are best suitable in place of non generic stack and queue collection classes ?
  1. List<>
  2. LIFOList<> and FIFOList<>
  3. Stack<> and Queue<>
  4. None of the above .
Show Answer
Share Facebook gmail Twitter
9
What is the use of Peek method present in non generic stack collection class ?
  1. Peek is same as Pop method, both will remove data from Stack in LIFO order.
  2. Peek is used only for removing First inserted item.
  3. Peek is used for reading Last inserted item without removing it.
  4. Peek used for removing last inserted item .
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :