C# and .
NET Programming - Unit I Guide
1. .NET Framework Architecture
- CLR (Common Language Runtime): Core component; handles memory management,
security, exception handling.
- CTS (Common Type System): Standardizes data types across languages.
- CLS (Common Language Specification): Defines a subset of features that all .NET languages
support.
- BCL (Base Class Library): Collection of reusable classes (e.g., [Link], [Link]).
- FCL (Framework Class Library): Extended library for developing applications.
- JIT (Just In Time Compiler): Converts MSIL (Intermediate Code) into native code.
2. .NET Class Hierarchy
Starts from [Link], the base of all classes.
Example:
[Link]
└── [Link]
└── [Link]
3. System Namespace
- Root of all other namespaces.
- Common Namespaces:
* System: Basic types like Int32, String.
* [Link]: Data structures like ArrayList, Hashtable.
* [Link]: File handling.
* [Link]: Networking.
* [Link]: Multithreading.
4. Introducing C#
a. Data Types
- Value types (stack): int, float, char, bool, struct.
- Reference types (heap): class, interface, delegate, string, object.
b. Boxing and Unboxing
- Boxing: Converting value type to reference type.
int num = 10;
object obj = num;
- Unboxing: Converting reference type to value type.
int num2 = (int)obj;
c. Flow Control
- Branching: if, else, switch.
- Looping: for, while, do-while, foreach.
- Jumping: break, continue, goto, return.
d. Arrays
- Single-Dimensional:
int[] arr = new int[5];
- Multi-Dimensional (2D):
int[,] matrix = new int[2,3];
- Jagged Arrays:
int[][] jagged = new int[3][];
jagged[0] = new int[2];