C# Introduction
C# (say "C sharp") is a modern, versatile language from Microsoft. It is used for Windows and web apps with ASP.NET, for games in Unity, and for mobile apps. C# runs on the .NET platform and works on Windows, macOS and Linux.
ExampleC#
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}Output
Hello, World!
using System; brings in common types. Console.WriteLine prints a line. Main is where the program starts. To try an example, create a project with dotnet new console and paste the code into Program.cs, then dotnet run.
Quick check
Which method prints a line in C#?
Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.
Tip: use the left and right arrow keys to move between lessons.