Value type VS Ref Type
-----------------------------
* A variable that is of type value directly contains a value. Assigning a variable of type value to another
variable of type value COPIES that value.
* A variable of type reference, points to a place in memory where the actual object is contained. Assigning a
variable of type reference to another variable of type reference copies that reference (it tells the new object
where the place in memory is), but does not make a copy of the object.
* Value types are stored on the stack.
* Reference types are stored on the heap.
* Value types can not contain the value null. *
* Reference types can contain the value null.
* Value types derive from System.ValueType.
* Reference types derive from System.Object.
* Changing the value of one value type does not affect the value of another value type.
* Changing the value of one reference type MAY change the value of another reference type.
------------------------------
Polymorphism/Run time polymorphism, how to acheive run time polymorphism
Managed VS Unmanaged code
Types of array in C#, Jagged array
-------------------------------------
//"jagged" array: araay of(array of int)
int[][] j2 = new int[3][];
j2[0] = new int[] {1, 2, 3};
j2[1] = new int[] {1, 2, 3, 4, 5, 6};
j2[2] = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
-------------------------------------
Types of operator in C#, specifically c# operators
--------------------------------------------------------------------------
Primary- I++, I--
Additive- + -
Relational- > < >= <=
Assignment- += -=
Ternary ? :
--------------------------------------------------------------------------
How to control overflow in c#, operator to use that
--------------------------------------------------------------------------
Use checked where it is a possible error condition which you want to catch.
int square(int i)
{
return i * i;
}
void f()
{
checked
{
int i = square(1000000);
}
}
--------------------------------------------------------------------------
Virtual Functions
-----------------------------
a virtual function or virtual method is a function or method whose behaviour can be overridden within an inheriting
class by a function with the same signature.
-----------------------------
Compilation of Code in .Net
-----------------------------
Developers using the CLR write code in a language such as C# or VB.NET. At compile time, a .NET compiler converts
such code into CIL code. At runtime, the CLR's just-in-time compiler converts the CIL code into code native to the
operating system.
-----------------------------
Operator Overloading
--------------------------------------------------------------------------
Operator overloading permits user-defined operator implementations to be specified for operations
&&, || They can’t be overloaded
() (Conversion operator) They can’t be overloaded
=, . , ?:, ->, new, is, as, size of These operators can’t be overloaded
In C#, a special function called operator function is used for overloading purpose. These special function or
method must be public and static.
--------------------------------------------------------------------------
-----------------------------
* A variable that is of type value directly contains a value. Assigning a variable of type value to another
variable of type value COPIES that value.
* A variable of type reference, points to a place in memory where the actual object is contained. Assigning a
variable of type reference to another variable of type reference copies that reference (it tells the new object
where the place in memory is), but does not make a copy of the object.
* Value types are stored on the stack.
* Reference types are stored on the heap.
* Value types can not contain the value null. *
* Reference types can contain the value null.
* Value types derive from System.ValueType.
* Reference types derive from System.Object.
* Changing the value of one value type does not affect the value of another value type.
* Changing the value of one reference type MAY change the value of another reference type.
------------------------------
Polymorphism/Run time polymorphism, how to acheive run time polymorphism
Managed VS Unmanaged code
Types of array in C#, Jagged array
-------------------------------------
//"jagged" array: araay of(array of int)
int[][] j2 = new int[3][];
j2[0] = new int[] {1, 2, 3};
j2[1] = new int[] {1, 2, 3, 4, 5, 6};
j2[2] = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9};
-------------------------------------
Types of operator in C#, specifically c# operators
--------------------------------------------------------------------------
Primary- I++, I--
Additive- + -
Relational- > < >= <=
Assignment- += -=
Ternary ? :
--------------------------------------------------------------------------
How to control overflow in c#, operator to use that
--------------------------------------------------------------------------
Use checked where it is a possible error condition which you want to catch.
int square(int i)
{
return i * i;
}
void f()
{
checked
{
int i = square(1000000);
}
}
--------------------------------------------------------------------------
Virtual Functions
-----------------------------
a virtual function or virtual method is a function or method whose behaviour can be overridden within an inheriting
class by a function with the same signature.
-----------------------------
Compilation of Code in .Net
-----------------------------
Developers using the CLR write code in a language such as C# or VB.NET. At compile time, a .NET compiler converts
such code into CIL code. At runtime, the CLR's just-in-time compiler converts the CIL code into code native to the
operating system.
-----------------------------
Operator Overloading
--------------------------------------------------------------------------
Operator overloading permits user-defined operator implementations to be specified for operations
&&, || They can’t be overloaded
() (Conversion operator) They can’t be overloaded
=, . , ?:, ->, new, is, as, size of These operators can’t be overloaded
In C#, a special function called operator function is used for overloading purpose. These special function or
method must be public and static.
--------------------------------------------------------------------------