A class in C# is a blueprint for creating objects, defined with the class keyword.
This page covers Class in C#. For a language-agnostic introduction, see Class.
Defining a Class#
public class Player
{
}public is the access modifier — it means the class can be used from anywhere in the program. The class body sits between the curly braces.
By convention, class names use PascalCase: Player, OddsAndEvens, RockPaperScissors.
Adding Fields and Properties#
A field stores data on the object. A property provides controlled access to that data.