Destructors
Destructors are the opposite of constructors. Destructors are also special methods that are called when the object is being destroyed. Objects use the memory of your computer and if they are not removed…
Constructors
Constructors are special methods that are required to create or “construct” objects. They allow you to assign the initial values for each data member of an array and add codes that…
Defining a Class
A C# class let’s you define a user-defined data type that contains fields, properties, and methods. A class serves as a blueprint for an object. The object is the actual thing that follows the…
Object Oriented Programming
Object Oriented Programming (OOP) involves defining classes and creating objects that resemble real life objects. For example, consider a car. The car has properties such as color, speed, model, manufacturer and…
Structures
structures or structs are user-defined data types that can contain other variables as its fields and methods as its behavior. You can create your very own customized data type using structures. Let…
Converting Enumerations
You can converting enumerations to other values and vice versa. Enumeration values are actually numeric values that are just masked by their names so that they can easily be understood.…
Enumeration
Enumeration is a way of defining your own type that can accept a predefined set of values identified by names. For example, you want a variable that can only store directions…
Command Line Arguments
To successfully run a C# application, you must provide a Main method. The Main() method is the starting point of the program. It is declared public or internal, and it must also be static. You can actually…
Delegates
Delegates are types that hold references to methods instead of variables. A delegate can copy the behavior of any method. To declare a delegate, you use the delegate keyword. Declaring a delegate is…
Recursion
Recursion is a process where a method calls itself repeatedly until it arrives on a desired value. Recursion is a complex topic in programming and mastering it is not that easy.…