3. Jagged Array: Jagged array is a collection of rows which may contain distinct number of elements in each row i.e., if the 1st row is having two elements, 2nd row may have three elements or it may depend upon our requirement.
Jagged array is a collection of 1-dimensional arrays.
Length Property: When we are working with one dimensional array length property will determine number of elements.
When we are working with jagged array length property will represent number of rows of jagged array.
Type Casting (or) Type Conversion: Converting from one data type to another data type is called as Type casting.
Whenever we want to convert from one data type value into some other data type variable we will go for type casting technique.
C#.Net will support Type casting in 3 ways: 1. Implicit type casting 2. Explicit type casting 3. Boxing & Unboxing type casting
1. Implicit type casting: Implicit type casting is not controlling by the program, which is controlling by the compiler.
To implement implicit type casting, Programmer need not to follow any special syntax, except assignment operator(=).
Whenever we want to convert form small size data type value to bigger size data type value we go for it.
Eg: For implicit type casting: Void main() { Short SNumber = 25; int iNumber = SNumber; Console.WriteLine("iNumber value is " +iNumber); Console.ReadLine(); } Output: iNumber is 25.
2. Explicit Type Casting: Explicit type Casting is controlling by the programmer.
To implement explicit type casting a programmer has to follow some special syntax.
Whenever we want to convert from bigger size data type to smaller size data type, we go for explicit type casting.
Explicit type casting we can implement by using three techniques. 1. C++ style of type casting. 2. Parsing 3. Converting