Aral Code

Getting Started Lesson 1 of 15

Introduction to C#

What C# is, what .NET is, where C# is used (Unity games, Windows apps, websites), and what a first C# program looks like.

C# was created at Microsoft by a team led by Anders Hejlsberg and released in 2000. It runs on .NET, a free, open-source platform that works on Windows, Mac and Linux. C# combines the power of C++ with the ease of languages like Java.

Your first C# program

Console.WriteLine("Mabuhay, Pilipinas!");

Output

Mabuhay, Pilipinas!

Yes, one line. Modern C# (version 9 and later) supports top-level statements: you can write code directly in the file, and C# creates the Main method for you behind the scenes. Console.WriteLine prints a line of text.

The classic version

Older tutorials, many textbooks and some school projects use the full structure. It does exactly the same thing:

using System;

namespace HelloApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Mabuhay, Pilipinas!");
        }
    }
}

Output

Mabuhay, Pilipinas!
  • using System; lets you use Console without writing System.Console.
  • namespace groups related code.
  • class Program holds the code; static void Main is where the program starts.

This course uses the short top-level style for most examples, so you can focus on what matters. Both styles are correct.

Where is C# used?

AreaExamples
GamesUnity games for phones, PC and consoles
Windows appsDesktop programs with WinForms, WPF or WinUI
Websites and APIsASP.NET Core powers many company and government sites
Mobile apps.NET MAUI for Android and iOS
Business systemsInventory, payroll and POS systems in many companies

Why learn C#?

  • Beginner-friendly: clear syntax and very helpful error messages.
  • Excellent tools: Visual Studio and VS Code suggest code as you type.
  • Strongly typed: many mistakes are caught before the program runs.
  • Games: it's the scripting language of Unity.
  • Jobs: many companies, including outsourcing firms in the Philippines, build business software with C# and .NET.

C# and Java

C# and Java are like cousins: both have classes, garbage collection, strong typing and C-style syntax. Key differences you'll notice: C# uses Console.WriteLine instead of System.out.println, method names start with a capital letter (ToUpper()), and C# has handy features like properties, string interpolation and LINQ.

Quick Quiz

Check what you learned. Walang grade ito, practice lang. 🙂

1. Which company created C#?
2. Which game engine uses C# for scripting?
3. What does Console.WriteLine("Hi"); do?
4. What are top-level statements?

By Sir Reyel · Last updated 2026-12-04