0% found this document useful (0 votes)
19 views3 pages

Dotnet Study Guide

Uploaded by

Pushpa Mewara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Dotnet Study Guide

Uploaded by

Pushpa Mewara
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

.

NET Framework Study Guide

1. .NET Framework Features & Architecture


The .NET Framework is a software development framework developed by Microsoft. It provides a
controlled programming environment where software can be developed, installed, and executed. Its
architecture consists of the Common Language Runtime (CLR), Base Class Library (BCL), and
development tools. Key features include memory management, security, language interoperability,
and exception handling.

2. CLR (Common Language Runtime)


CLR is the heart of .NET, responsible for managing the execution of .NET programs. It handles
memory allocation, garbage collection, type safety, exception handling, and JIT compilation.
Example: A C# program is compiled into MSIL, which is then executed by CLR after being
converted into native code.

3. Common Type System (CTS)


CTS defines how types are declared, used, and managed in the runtime. It ensures cross-language
integration by enforcing a common set of rules. Example: int in C# is System.Int32 in CTS.

4. MSIL (Microsoft Intermediate Language)


All .NET languages compile code into MSIL, which is a CPU-independent set of instructions. The
CLR then compiles MSIL into native code. Example: A simple addition operation in C# becomes a
series of MSIL instructions.

5. Assemblies and Class Libraries


Assemblies are the building blocks of .NET applications (DLL or EXE files). They contain MSIL
code and metadata. Class libraries provide reusable classes. Example: System.IO for file handling.

6. Variables & Data Types


Variables store data in memory. Data types are classified as value types (int, float, bool, struct) and
reference types (string, objects, arrays). Example: int x = 10; string name = "John";

7. Forcing Variable Declarations


In VB.NET, Option Explicit enforces variable declarations. In C#, all variables must be declared
explicitly. Example: int y; y = 5;

8. Scope & Lifetime of a Variable


Scope defines the visibility of a variable, while lifetime defines how long it exists. Example: A local
variable inside a method is destroyed when the method exits.
9. Control Flow Statements
Control flow determines the execution path of the program. - Conditional Statements: if, if-else,
switch Example: if (x > 10) { Console.WriteLine("Greater"); } - Loop Statements: for, while, do-while,
foreach Example: for (int i=0; i<5; i++) { Console.WriteLine(i); }

10. Constants, Arrays, Collections


- Constants: Immutable values. Example: const double PI = 3.14; - Arrays: Fixed-size,
strongly-typed collection. Example: int[] nums = {1,2,3}; - Collections: Flexible data structures like
List, Dictionary. Example: List names = new List() { "A", "B" };

11. Subroutines & Functions


Subroutines (void methods) perform actions, functions return values. Example: void PrintMsg() {
Console.WriteLine("Hello"); } Example: int Add(int a, int b) { return a+b; }

12. Passing Variable Number of Arguments & Optional Arguments


Using 'params' keyword, methods can accept variable arguments. Example: int Sum(params int[]
nums) { return nums.Sum(); } Optional arguments allow default values. Example: void Greet(string
name="Guest") { Console.WriteLine("Hello " + name); }

13. Returning Values from Functions


Functions return values using return keyword. Example: double Square(double x) { return x*x; }

14. MsgBox & InputBox


In VB.NET, MsgBox displays messages and InputBox gets user input. Example: MsgBox("Hello");
name = InputBox("Enter Name:");

15. Overloading
Method overloading allows multiple methods with the same name but different signatures. Example:
int Add(int a, int b), double Add(double a, double b).

16. Constructor
Constructors initialize objects. Example: class Student { public Student(string name) { this.Name =
name; } }

17. Inheritance, Overriding, Interfaces


- Inheritance: Deriving one class from another. Example: class Car : Vehicle {} - Overriding:
Changing base class method using 'override' keyword. Example: public override void Drive() { ... } -
Interfaces: Define contracts. Example: interface IShape { void Draw(); }

You might also like