Set - 9

Question 16 :

How can you sort the elements of the array in descending order?

Answer :

By calling Sort() and then Reverse() methods.


Question 17 :

What's the .NET collection class that allows an element to be accessed using a unique key?

Answer :

HashTable.


Question 18 :

What class is underneath the SortedList class?

Answer :

A sorted HashTable.


Question 19 :

Will the finally block get executed if an exception has not occurred?

Answer :

Yes.


Question 20 :

What's the C# syntax to catch any possible exception?

Answer :

A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.