Tagged: c#

C# Multithreading 0

C# Multithreading

Multi-threading is the ability of CPU to execute small parts of a program (known as threads), simultaneously. Multitasking allows your program to perform more than one task at a time. It makes your program run faster.


C# Abstract class

An abstract is a type of class that cannot be instantiated. It only allows other classes to inherit from it. The purpose of an abstract class is to provide a common definition of a base class that all derived classes should share. In C#, an abstract class is declared using abstract keyword.


C# Interface

An Interface contains declarations of methods, properties, events etc that a class and structs can inherit. In C#, an interface is created using interface keyword.


C# Operators

In programming languages, an operator is a symbol that instructs the compiler to perform some operations.


Creating an infinite loop in C#

In programming, a loop is a set of statements that are executed until a given expression is evaluated to false. An infinite loop (or endless loop) is a loop that is executed endlessly.


C# do-while loop

The main difference between a while and do-while loop is that in a do-while loop, the statements in the loop will be executed at least once.


C# while loop

A while loop is used to repeatedly execute a set of statements as long as the condition remains true.


C# try-catch-finally

In C#, try, catch and finally keywords are used to handle exceptions. An exception is an error that occurs during the execution of the program.


C# try-finally

Code specified in finally block is always executed when control leaves a try block. It can be used to release resources used in the try block. For example, closing any database connections or files opened in the try block.


C# throw keyword

In C#, throw keyword is used to raise an exception manually. Exceptions derived from System.Eception can be thrown using throw keyword.