State

Field

A field is a variable that belongs to an object. It holds a piece of data that describes the object’s state — its name, its score, its position.

Each object created from a class has its own copy of the fields defined in that class. One Player object might have Name = "Alice" and another might have Name = "Bob" — they share the same class but hold different values.