Classes
A free lesson from Swipe Coding · C#, level 1 · updated October 2026
By the Swipe team, founded by Colin · how we make lessons
In C#, the code you write typically lives inside a class. A class is like a container or blueprint that holds your program's code together — its data and the actions it can perform.
class Program
{
}The keyword "class" tells the C# compiler: "A new class starts here." Sometimes it is preceded by "public" — this means the class is visible and usable from other parts of a larger project, not just within its own file.
public class Car
{
}In C#, the code you write typically belongs inside a ____.
By convention, a class name starts with a capital letter and uses "PascalCase" for multiple words — for example "Program", "Car", or "BankAccount". This isn't a strict compiler rule, but practically every C# developer follows it so code looks consistent for everyone.
What best describes a class in C#?
For everything you'll learn in this level, a C# program's code is housed inside at least one class. Next, we'll look at how a program inside such a class actually starts running: with the Main() method.
A class name conventionally starts with a lowercase letter in C#.
Keep your streak going in Swipe Coding
Swipe through every level of C# on your iPhone — with XP, stars, streaks, a personal advisor and the full track beyond these free levels.
Get the Swipe apps →