Tag Archives: C#

What is a Statement in C#?

In C#, statements express the actions that a program takes. Common actions include Declaring variables Assigning values Calling methods Looping through collections Branching to another block of code The order in which statements are executed in a program is called the flow of control or flow of execution. This may vary every time that a […]

C#: how to write Hello World

The “Hello, World” program is traditionally used to introduce a programming language. Here it is in C#: using System; class Hello { static void Main() { Console.WriteLine(“Hello, World”); } } What’s the file extension? C# source files typically have the file extension .cs. How to compile? You can compile the program with the Microsoft C# […]

C# – What is a derived class?

As the name implies, a derived class originates from another class, which in C# is called a base class. A derived class is a specialization of the base class. A derived class is created from an existing base class. It inherits the member variables and methods of the base class from which it is derived. […]