C# Generics

Generics in C# allows defining the specification of the data type of programming elements in a class or a method until it is actually used in the program. Specification for the class or method can be written with substitute parameters for the data type. Following are some important features of Generic: Generics in C# helps to … Read more

C# Properties

Properties in C# are known as the members of a class that can be used to set and get the data from a data field of a class. Properties are not particularly used to store data in C#, they are just like an interface to transfer the data. Properties are defined as the named members … Read more

C# Indexers

Indexers in C# allow an object to be indexed like an Array. When you define an indexer for a class, this class behaves similar to a virtual array. You can then access the instance of this class using the array access operator ([ ]). In C#, Indexers are known as the special kind of attribute which allows … Read more

C# Operator Overloading

Operator Overloading is defined as a process of defining and implementing the polymorphism technique. Operator Overloading in C# is consists of operators which are functions with special names the keyword operator followed by the symbol for the operator being defined. Syntax: Given below is the syntax of operator overloading implementation, Overloading can be done on both Unary … Read more

C# Tuple

A tuple is a data structure in the C# language. A tuple is known as the data structure that contains a sequence of elements having different data types. Syntax: Characteristics of Tuples: C# Tuple can store duplicate elements. Tuple allows to create, access and manipulate data set. Tuple also allows to represent multiple data into … Read more

C# Type Conversion

C# Type Conversion is a mechanism to convert one data type value to another one. Type conversion is possible if both the data types are compatible to each other; otherwise you will get an InvalidCastException. It is also called Type Casting. In C# Type Conversion is consist of 2 major forms: Explicit type conversion Implicit … Read more

Categories C#

C# Events

An event is a mechanism for communication between objects. When something happens such as a key press or an error, an event can notify other objects about it. C# Events are used for inter-process communication. Events are known as the user actions such as mouse movements, keypress, and clicks, etc. In C# applications have to … Read more

Categories C#

C# Attributes

C# Attributes are very useful in a programming language. In C# attributes are used to bring metadata about various code elements which include methods, properties, and types. They can be placed on certain entities in the source code to specify additional information. To add attributes in the code ([ ]) are used at the top … Read more

Categories C#

C# Exception Handling

C# Exception handling is defined as the way to tell the program to move on to the next block of code or provide the defined result in certain situations. An exception is considered as the problem that arises during the execution of a program. It occurs when an exceptional situation happens in the program. In C# … Read more

Categories C#

C# Preprocessor Directives

C# Preprocessor directives are known as the set which gives instruction to the compiler to preprocess the information before actual compilation starts. In C# all Preprocessor Directives start with #. These commands specifies which sections of the code to compile or how to handle specific errors and warnings. The preprocessor directives are used to help … Read more

Categories C#