A class and an Interfaceare two different types (conceptually). Theoretically a class emphasis the idea of encapsulation, while an interface emphasis the idea of abstraction (by suppressing the details of the implementation). The two poses a clear separation from one to another. Therefore it is very difficult or rather impossible to have an effective meaningful comparison between the two.

Array: collection of similar data types. Array is reference type and hence it is stored in a Heap memory. Types of array are single dimensional, multi-dimensional and jagged Arrays (array of arrays).

A jagged array is an array whose elements are arrays

Declaring and initializing jagged array.

int[][] jaggedArray = new int[5][]; jaggedArray[0] = new int[3];

jaggedArray[1] = new int[5];

jaggedArray[2] = new int[2];

jaggedArray[3] = new int[8];

jaggedArray[4] = new int[10];

jaggedArray[0] = newint[] { 3, 5, 7, };

jaggedArray[1] = newint[] { 1, 0, 2, 4, 6 };

jaggedArray[2] = newint[] { 1, 6 };

jaggedArray[3] = newint[] { 1, 0, 2, 4, 6, 45, 67, 78 };

jaggedArray[4] = newint[] { 1, 0, 2, 4, 6, 34, 54, 67, 87, 78 };

_________________________________________________________________

Early Binding vs Late Binding

Binding refers the object type definition.

Early binding allows developers to interact with the object’s properties and methods during coding. You can enjoy the benefits of intellisense. Early binding permits the compiler to check your code. Errors are caught at compile time. Early binding also results in faster code. It’s disadvantage is that you cannot create a generic object which may be bound to different types of objects. Method Overloading is implemented by early binding.

Late binding on the other hand permits defining generic objects which may be bound to different objects. Eg: you could declare myControl as Control without knowing which control you will encounter. You could then query the Controls collection and determine which control you are working on using the TypeOf method and branch to the section of your code that provides for that type. This is the only benefit of late binding. It’s disadvantages are that it is error prone and you will not enjoy much intellisense whils coding.Method Overriding is implemented by late binding.

Memory Management: In .NET the memory management is done by the CLR. When the heap memory is exhausted the CLR calls the GC (Garbage collector).

The garbage collector's optimizing engine determines the best time to perform a collection based on the allocations being made. When the garbage collector performs a collection, it releases the memory for objects that are no longer being used by the application. It determines which objects are no longer being used by examining the application's roots. Every application has a set of roots. Each root either refers to an object on the managed heap or is set to null. An application's roots include global and static object pointers, local variables and reference object parameters on a thread's stack, and CPU registers. The garbage collector has access to the list of active roots that the just-in-time (JIT) compiler and the runtime maintain. Using this list, it examines an application's roots, and in the process creates a graph that contains all the objects that are reachable from the roots.

GC has 3 generations 0, 1 & 2 based on which the Garbage collector does the memory management of the heap.