A class is a blueprint for creating objects. It defines what data an object holds and what it can do — all in one place.
Classes are the main building block of object-oriented programming. Instead of writing all your code in one file, you split it into classes — each one responsible for one thing.
Defining a Class#
A class has a name and a body. The body contains the data and behaviour that belong to it. The exact syntax depends on the language — see the language-specific pages below.