What is metadata? What information is stored in Metadata?
A bunch of tables, metadata is what makes assemble self-describe.
What are some of the Tables stored in metadata?
TypeDefinition table, TypeReference table
AssemblyRef table
What are the two basic kinds of types in .net framework?
Reference type (live in managed heap) and value type(live on stack). A class is a reference type. A struct is a value type.
What is boxing and unboxing?
Packing an value type and make a copy on the heap so it can be used by a function
That’s needs a reference type, unboxing is the opposite process.
What class does all classes implicitly inherited from?
System.Object
What is namespace, assembly?
Namespace is used to group related types. Assembly is a compilation unit.
What is global assembly cache, what is the purpose?
GAC(Global assembly Cache) is used to share assemblies across applications
What are Primitive types?
A: Primitive types has built-in compiler support, compiler knows how to cast. Etc.
What is reflection?
A way to figure out the type information at run time from an assembly’s metadata.
What is a delegate?
Type safe call back mechanism.
Describe the accessibility modifier “protected internal”.
It is available to classes that are within the same assembly and derived from the specified base class.
What does the term immutable mean?
The data value may not be changed. Note: The variable value may be changed, but the original immutable data value was discarded and a new data value was created in memory.
What’s the difference between System.String and System.Text.StringBuilder classes?
System.String is immutable. System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.
What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where there is a large amount of string manipulation. Strings are immutable, so each time a string is changed, a new instance in memory is created.
Can you store multiple data types in System.Array?
No.
What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object.
How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
What’s the .NET collection class that allows an element to be accessed using a unique key?
HashTable.
Will the finally block get executed if an exception has not occurred?
Yes.
Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).