In object oriented programming, you have objects which have state and support some operations. The state and stuff is wildly different for some different objects (e.g. an object representing a bank account in a financial program, vs an object representing a car in a racing simulator). So we can't treat all objects the same way.
A class represents a bunch of objects which work similarly. If you know that an object belongs to some class, then you know some kinds of things you can do with it. Objects representing a bank account might support operations like deposit
, withdraw
, getBalance
, getAccountHolder
.
Talking about "the class of objects which support the deposit
, withdraw
, getBalance
, and getAccountHolder
operations", or "the class of objects which support the accelerate
, and getSpeed
, and steer
methods" is just normal use of the word "class" (and is related to "classify", which basically just means "to put into classes"; the word "class" as in a group of students is quite different).
Obviously, you pretty quickly want to name particular classes, so that you can just say BankAccount
or RacingCar
, rather than "the class of objects which support ...".
So a class is just that; a "thing" that defines what is common to the objects which are instances of the class.