top
upGrad KnowledgeHut SkillFest Sale!

Search

C# Tutorial

C# is an object-oriented programming developed by Microsoft that uses the .Net Framework. It utilizes the Common Language Interface (CLI) that describes the executable code as well as the runtime environment. C# can be used for various applications such as web applications, distributed applications, database applications, window applications etc. For greater understanding of this tutorial, a basic knowledge of object-oriented languages such as C++, Java etc. would be beneficial.C# is a general-purpose object-oriented programming language developed by Microsoft and approved as a standard by the ECMA and ISO. It runs on the .NET Framework.C# IndexLesson 1 - C# Introduction C# History and Versions C# Features C# 7 New Features (Current Version)Lesson 2 - Java vs. C# Lesson 3 - IDEs to run C# program IDE for Windows IDE for Mac IDE for LinuxLesson 4 - Set Environment What is Visual Studio 2017 IDE? Install Microsoft Visual Studio Community 2017 Lesson 5 - First C# Program Create a new project in Visual Studio Run the program Lesson 6 - Data Types in C# Value Data Types Reference Data Types Pointer Data Types Lesson 7 - Variables and Constants in C# Variables in C# Variable Definition and Initialization Constants in C# Lesson 8 - Operators in C# Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Miscellaneous Operators Operator Precedence in C# Lesson 9 - Namespaces in C# Nested Namespaces Namespace in C# vs. Packages in Java Lesson 10 - Decision Making Statements in C# if Statement in C# If…else Statement in C# switch statement in C# Lesson 11 - Loops in C#   for loop in C# while loop in C# do while loop in C# Nested loops in C# foreach loop in C# Lesson 12 - Arrays in C# 1-D Arrays 2-D Arrays Jagged Arrays Param Arrays Passing Arrays to Functions Array Operations Array ClassLesson 13 - Strings in C#String Constructors String Properties String Methods String Operations Lesson 14 - HashSet Collection in C# Constructors in HashSet Collection Properties in HashSet Collection Methods in HashSet Collection HashSet Operations Lesson 15 - Stack Collection in C# Constructors in Stack Collection Properties in Stack Collection Methods in Stack Collection Stack OperationsLesson 16 - Queue Collection in C# Constructors in Queue Collection Properties in Queue Collection Methods in Queue Collection Queue Operations Lesson 17 - LinkedList Collection in C# Constructors in LinkedList CollectionProperties in LinkedList Collection Methods in LinkedList Collection Create a Linked List Linked List Operations Lesson 18 - Dictionary Collection in C# Constructors in Dictionary Collection Properties in Dictionary Collection Methods in Dictionary Collection Dictionary OperationsLesson 19 - SortedList Collection in C# Constructors in SortedList Collection Properties in SortedList Collection Methods in SortedList Collection SortedList Operations Lesson 20 - BitArray Collection in C# Constructors in BitArray Collection Properties in BitArray CollectionMethods in BitArray Collection BitArray Operations Lesson 21 - ArrayList Collection on C# Constructors in ArrayList Collection Properties in ArrayList Collection Methods in ArrayList Collection ArrayList Operations Lesson 22 - Methods in C# Method Definition in C# Method Calling in C# Recursion in C# Passing By Value Passing By Reference Output Parameters Lesson 23 - Anonymous Methods in C# Salient Points of Anonymous Methods Limitations of Anonymous Methods Lesson 24 - Classes and Objects in C# Class Definition Object Definition Static Variables in Class Static Function in Class Lesson 25 - Constructors in C# Default Constructor Parameterized Constructor Copy Constructor Lesson 26 - Static Keyword in C# Static Class Static Constructor Lesson 27 - Inheritance in C#Base Class and Derived Class Single Level Inheritance Hierarchical InheritanceMulti-Level Inheritance Multiple Inheritance Using Interfaces Lesson 28 - Interfaces in C# Interface Definition Lesson 29 - Abstraction in C# Lesson 30 - Delegates in C# Lesson 31 - Structures in C# Structure Definition Structures vs Classes Lesson 32 - Preprocessor Directives in C# The #define Preprocessor Directive The #undef Preprocessor Directive The #if Preprocessor Directive The #elif Preprocessor Directive The #warning Preprocessor Directive Lesson 33 - Type Conversion in C# Implicit Type Conversion Explicit Type Conversion Convert class in C# Lesson 34 - Exception Handling in C# Exception Handling Keywords User Defined Exceptions Lesson 35 - Polymorphism in C# Static Polymorphism Dynamic Polymorphism Lesson 36 - Nullables in C# Null Coalescing Operator Lesson 37 - Reflection in C#Uses of Reflection System.Reflection Namespace TypeInfo Class Program 1: Display methods and properties of a class Program 2: Display the types of various variables using GetType() method Program 3: AssemblyQualifiedName Property Program 4: Assembly Property Program 5: Name property Program 6: FullName property Lesson 38 - Regular Expressions in C# Regex Class Program 1 Program 2 Lesson 39 - Multithreading in C# The Thread Life Cycle The Thread ClassLesson 40 - Indexers in C# Indexer Syntax Indexer Program Lesson 41 - File Handling in C# The System.IO NamespaceFileStream Class StreamReader and StreamWriter Class TextReader Class and TextWriter Class BinaryReader Class and BinaryWriter Class StringReader Class and StringWriter Class Lesson 42 - Attributes in C# Attribute Uses Attribute Syntax Predefined Attributes Lesson 43 - Generics in C# Salient Points of Generics Generic Classes and Generic Methods Lesson 44 - Events in C# Event Syntax Lesson 45 - Synchronization in C# Methods to manage Synchronization Lesson 46 - Serialization in C# Example of Serialization Lesson 47 - Properties in C# Use of Assessors in Properties Program using get and set Accessors Lesson 48 - Enums in C# Enum Syntax Enum Example Loop through the values of enum Methods of Enum Enum with Customized Value Compare enum members Enum keyword to define a variable type Enum isDefined() Method Enum Equals Method Enum Parse() Method Enum ToString() Method Enum TryParse() Method Enum CompareTo() method Enum Format() Method Enum GetName() Method Enum GetNames() Method Type of the specified Enumeration Enum GetValues() Method Lesson 49 - Unsafe Code in C# Using Unsafe Code in Visual Studio IDE Examples of Unsafe Code
logo

C# Tutorial

C# Tutorial

C# is an object-oriented programming developed by Microsoft that uses the .Net Framework. It utilizes the Common Language Interface (CLI) that describes the executable code as well as the runtime environment. C# can be used for various applications such as web applications, distributed applications, database applications, window applications etc. 

For greater understanding of this tutorial, a basic knowledge of object-oriented languages such as C++, Java etc. would be beneficial.

C# is a general-purpose object-oriented programming language developed by Microsoft and approved as a standard by the ECMA and ISO. It runs on the .NET Framework.

C# Index

Lesson 1 - C# Introduction 

C# History and Versions 

C# Features 

C# 7 New Features (Current Version)

Lesson 2 - Java vs. C# 

Lesson 3 - IDEs to run C# program 

IDE for Windows 

IDE for Mac 

IDE for Linux

Lesson 4 - Set Environment 

What is Visual Studio 2017 IDE? 

Install Microsoft Visual Studio Community 2017 

Lesson 5 - First C# Program 

Create a new project in Visual Studio 

Run the program 

Lesson 6 - Data Types in C# 

Value Data Types 

Reference Data Types 

Pointer Data Types 

Lesson 7 - Variables and Constants in C# 

Variables in C# 

Variable Definition and Initialization 

Constants in C# 

Lesson 8 - Operators in C# 

Arithmetic Operators 

Relational Operators 

Logical Operators 

Bitwise Operators 

Assignment Operators 

Miscellaneous Operators 

Operator Precedence in C# 

Lesson 9 - Namespaces in C# 

Nested Namespaces 

Namespace in C# vs. Packages in Java 

Lesson 10 - Decision Making Statements in C# 

if Statement in C# 

If…else Statement in C# 

switch statement in C# 

Lesson 11 - Loops in C#   

for loop in C# 

while loop in C# 

do while loop in C# 

Nested loops in C# 

foreach loop in C# 

Lesson 12 - Arrays in C# 

1-D Arrays 

2-D Arrays 

Jagged Arrays 

Param Arrays 

Passing Arrays to Functions 

Array Operations 

Array Class

Lesson 13 - Strings in C#

String Constructors 

String Properties 

String Methods 

String Operations 

Lesson 14 - HashSet Collection in C# 

Constructors in HashSet Collection 

Properties in HashSet Collection 

Methods in HashSet Collection 

HashSet Operations 

Lesson 15 - Stack Collection in C# 

Constructors in Stack Collection 

Properties in Stack Collection 

Methods in Stack Collection 

Stack Operations

Lesson 16 - Queue Collection in C# 

Constructors in Queue Collection 

Properties in Queue Collection 

Methods in Queue Collection 

Queue Operations 

Lesson 17 - LinkedList Collection in C# 

Constructors in LinkedList Collection

Properties in LinkedList Collection 

Methods in LinkedList Collection 

Create a Linked List 

Linked List Operations 

Lesson 18 - Dictionary Collection in C# 

Constructors in Dictionary Collection 

Properties in Dictionary Collection 

Methods in Dictionary Collection 

Dictionary Operations

Lesson 19 - SortedList Collection in C# 

Constructors in SortedList Collection 

Properties in SortedList Collection 

Methods in SortedList Collection 

SortedList Operations 

Lesson 20 - BitArray Collection in C# 

Constructors in BitArray Collection 

Properties in BitArray Collection

Methods in BitArray Collection 

BitArray Operations 

Lesson 21 - ArrayList Collection on C# 

Constructors in ArrayList Collection 

Properties in ArrayList Collection 

Methods in ArrayList Collection 

ArrayList Operations 

Lesson 22 - Methods in C# 

Method Definition in C# 

Method Calling in C# 

Recursion in C# 

Passing By Value 

Passing By Reference 

Output Parameters 

Lesson 23 - Anonymous Methods in C# 

Salient Points of Anonymous Methods 

Limitations of Anonymous Methods 

Lesson 24 - Classes and Objects in C# 

Class Definition 

Object Definition 

Static Variables in Class 

Static Function in Class 

Lesson 25 - Constructors in C# 

Default Constructor 

Parameterized Constructor 

Copy Constructor 

Lesson 26 - Static Keyword in C# 

Static Class 

Static Constructor 

Lesson 27 - Inheritance in C#

Base Class and Derived Class 

Single Level Inheritance 

Hierarchical Inheritance

Multi-Level Inheritance 

Multiple Inheritance Using Interfaces 

Lesson 28 - Interfaces in C# 

Interface Definition 

Lesson 29 - Abstraction in C# 

Lesson 30 - Delegates in C# 

Lesson 31 - Structures in C# 

Structure Definition 

Structures vs Classes 

Lesson 32 - Preprocessor Directives in C# 

The #define Preprocessor Directive 

The #undef Preprocessor Directive 

The #if Preprocessor Directive 

The #elif Preprocessor Directive 

The #warning Preprocessor Directive 

Lesson 33 - Type Conversion in C# 

Implicit Type Conversion 

Explicit Type Conversion 

Convert class in C# 

Lesson 34 - Exception Handling in C# 

Exception Handling Keywords 

User Defined Exceptions 

Lesson 35 - Polymorphism in C# 

Static Polymorphism 

Dynamic Polymorphism 

Lesson 36 - Nullables in C# 

Null Coalescing Operator 

Lesson 37 - Reflection in C#

Uses of Reflection 

System.Reflection Namespace 

TypeInfo Class 

Program 1: Display methods and properties of a class 

Program 2: Display the types of various variables using GetType() method 

Program 3: AssemblyQualifiedName Property 

Program 4: Assembly Property 

Program 5: Name property 

Program 6: FullName property 

Lesson 38 - Regular Expressions in C# 

Regex Class 

Program 1 

Program 2 

Lesson 39 - Multithreading in C# 

The Thread Life Cycle 

The Thread Class

Lesson 40 - Indexers in C# 

Indexer Syntax 

Indexer Program 

Lesson 41 - File Handling in C# 

The System.IO Namespace

FileStream Class 

StreamReader and StreamWriter Class 

TextReader Class and TextWriter Class 

BinaryReader Class and BinaryWriter Class 

StringReader Class and StringWriter Class 

Lesson 42 - Attributes in C# 

Attribute Uses 

Attribute Syntax 

Predefined Attributes 

Lesson 43 - Generics in C# 

Salient Points of Generics 

Generic Classes and Generic Methods 

Lesson 44 - Events in C# 

Event Syntax 

Lesson 45 - Synchronization in C# 

Methods to manage Synchronization 

Lesson 46 - Serialization in C# 

Example of Serialization 

Lesson 47 - Properties in C# 

Use of Assessors in Properties 

Program using get and set Accessors 

Lesson 48 - Enums in C# 

Enum Syntax 

Enum Example 

Loop through the values of enum 

Methods of Enum 

Enum with Customized Value 

Compare enum members 

Enum keyword to define a variable type 

Enum isDefined() Method 

Enum Equals Method 

Enum Parse() Method 

Enum ToString() Method 

Enum TryParse() Method 

Enum CompareTo() method 

Enum Format() Method 

Enum GetName() Method 

Enum GetNames() Method 

Type of the specified Enumeration 

Enum GetValues() Method 

Lesson 49 - Unsafe Code in C# 

Using Unsafe Code in Visual Studio IDE 

Examples of Unsafe Code

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments

austin faith

Avery good write-up. Please let me know what are the types of C# libraries used for AI development.

kariya arti

very satisfied!!

jean-Francois Michaud

Good tutorial. Small question: Say, there is : enum numbers { one, two, three} and a string field_enum ="one" how would I from the variable field_enum have a response with value numbers.one so that it can be treated as an enum and not as a string. making a list from the enum, and loop into the list. is not elegant... and may not work is forced value on field is forced ( one = 100).

Kshitiz

Hi Team Knowledge Hut, Thank you for such an informative post like this. I am completely new to this digital marketing field and do not have much idea about this, but your post has become a supportive pillar for me. After reading the blog I would expect to read more about the topic. I wish to get connected with you always to have updates on these sorts of ideas. Regards, Kshitiz

Ed

The reason abstraction can be used with this example is because, the triangle, circle. Square etc can be defined as a shape, for example.....shape c = new circle(5,0)...the abstract object c now points at the circle class. Thus hiding implementation

Suggested Tutorials

Swift Tutorial

Introduction to Swift Tutorial
Swift Tutorial

Introduction to Swift Tutorial

Read More

R Programming Tutorial

R Programming

Python Tutorial

Python Tutorial