What is "classes"

Class structure

A class defines the state and behavior of an object usually by implementing methods and attributes (names used in most modern languages). The attributes, also called fields (from English Fields), indicate the possible information stored by a class object, representing the state of each object. Methods are procedures that form the behaviors and services offered by objects in a class.

Other possible members of a class are:

  • Constructors - define the behavior at the moment of the creation of a object of a class.
  • Destructor - defines behavior at the time of object destruction of a class. Normally, as in C++, it is used to release system resources (such as memory), already in other languages, such as in Java and C This is done automatically by Garbage Collector.
  • Properties - defines access to a state of the object.
  • Events - defines a point at which the object can call others procedures according to their behavior and internal state.