Professional Documents
Culture Documents
Answer :
CorDBG command-line debugger, and DbgCLR graphic debugger. Visual Studio .NET uses the DbgCLR. To use CorDbg, you must compile the original C# file using the /debug switch.
Question : How do you generate documentation from the C# file commented properly with a command-line compiler? Answer :
Compile it with a /doc switch.
Question : Whats the C# equivalent of C++ catch (), which was a catch-all statement for 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 {}.
Question : Whats the .NET datatype that allows the retrieval of data by a unique key? Answer :
HashTable
Answer :
The first one performs a deep copy of the array, the second one is shallow.
ArrayList 1) Namespace System.Collections contain ArrayList ( This namespace is added by default when we we creat any aspx page in C#) 2) Create ArrayList : ArrayList stringArrayList = new ArrayList(); Here we dont need to specify object type arraylist going to contain,store different type of objects/items/ 3) In ArrayList each item is stored as an Object so while reteriving we can get object only. 4) It is like Array of Objects.
List<T> 1) Namespace System.Collections.Generic List<T> ( we need to add namespace if we want to use Generic Types) 2) Create List<T>: List<string> stringList = new List<string>(); i.e. List<type> nameOfList = new List<type>(); & type means object type which List<T> going to hold. 3) In List<T> , it can hold/contain only type of object which is mentioned while initialising the List<T> Just like in above example stringList will only contain object of type string, the type supplied as generic parameter. 4) It is newly added in .Net 2.0 & onwards, fast processing no need of casting explicitly.
Question : Can you change the value of a variable while debugging a C# application? Answer :
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window.
Question : Whats the difference between // comments, /* */ comments and /// comments? Answer :
Single-line, multi-line and XML documentation comments.
1. 2. 3. 4. 5. 6.
System.Globalization, System.Resources.
Question : Whats the difference between System.String and System.StringBuilder classes? Answer :
System.String is immutable, System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.