adplus-dvertising
frame-decoration

Question

A HashTable t maintains a collection of names of states and capital city of each state.Which among the following finds out whether “New delhi” state is present in the collection or not?

a.

t.HasValue(“New delhi”);

b.

t.ContainsKey(“New delhi”);

c.

t.HasKey(“New delhi”);

d.

t.ContainsValue(“New delhi”);

Posted under C# programming

Answer: (b).t.ContainsKey(“New delhi”);

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. A HashTable t maintains a collection of names of states and capital city of each state.Which among the following finds out whether “New delhi” state is present in the collection or...

Similar Questions

Discover Related MCQs

Q. Which among the given statements are correct about the Stack collection?

Q. Among the given collections which one is I/O index based?

Q. Which statements among the following are correct about the Collection Classes available in Framework Class Library?

Q. Which is the correct statement about an ArrayList collection that implements the IEnumerable interface?

Q. Which among the following is the correct way to find out the number of elements currently present in an ArrayListCollection called arr?

Q. Which among the following is not an interface declared in System.Collection namespace?

Q. Which among the following is not the ordered collection class?

Q. Which of the following statements are correct about the Collection Classes available in Framework Class Library?

Q. Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?

Q. 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?

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

Q. 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?

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

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