The class variable is related to object-oriented programming. This refers specifically to a variable that represents an attribute of a class object. The current values of class variables describe the state of a class object. They are accessible to all instances of the corresponding class. Since there is exactly one class object for each class, each class variable is created only once.