C# programs work with simple built-in value types and with custom classes.
For introductory reasoning, compare:
int jerseyNumber;
bool isAvailable;
double distanceMeters;with:
Player player1;
Team team1;The first group represents basic values.
The second group represents object references to custom types.
Examples include:
A field such as:
int jerseyNumber;is designed to hold one whole-number value.
A Player object can contain several related fields.
Conceptually:
Player
- name
- jerseyNumber
- isAvailable
- teamThat is more structured than one integer or Boolean.
The class gives the program a type for the complete Player concept.
You have used:
string playerName = "Jordan";For beginner code, string often feels similar to the basic value types because you assign and display text directly.
Technically, string is a reference type in C#.
You do not need advanced memory details here.
The useful distinction is that custom classes such as Player also produce object references and can contain their own structured state.
A field declared as:
int jerseyNumber;expects an integer-compatible value.
A field declared as:
Team team;expects a compatible Team reference.
The compiler uses type information to prevent many mismatched assignments.
Ask:
For:
jersey numberan int may fit.
For:
playera custom Player class can fit.
The type should communicate the meaning of the information.
Do not reduce the topic to:
A better idea is:
built-in/basic value types represent common individual values;
custom class types let the application represent concepts specific to its domain.