C# interview questions and answers By admin | December 7, 2003 1.What’s the advantage of using System.Text.StringBuilder over System.String? StringBuilder is more efficient in the cases, where a lot of manipulation is done to the text. Strings are immutable, so each time it’s being operated on, a new instance is created. 2.Can you store multiple data types in System.Array? No. 3.What’s the difference between the System.Array.CopyTo() and System.Array.Clone()? The first one performs a deep copy of the array, the second one is shallow. 4.How can you sort the elements of the array in descending order? By calling Sort() and then Reverse() methods. 5.What’s the .NET datatype that allows the retrieval of data by a unique key? HashTable. 6.What’s class SortedList underneath? A sorted HashTable. 7.Will finally block get executed if the exception had not occurred? Yes. 8.What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception? A catch blo
Comments
Post a Comment