Metaclass

from Wikipedia, the free encyclopedia

In object orientation, a metaclass is the class of a class. It defines procedures for creating instances of the class whose metaclass it is, as well as static methods , i.e. those for whose execution no objects are required.

Not all object-oriented programming languages ​​support the metaclass concept or some only do it to a certain extent.

Languages ​​with metaclasses

The following programming languages ​​support metaclasses:

as well as the description languages:

Real metaclasses are used, for example, in the Smalltalk or Python programming language . These metaclasses are themselves classes from which subclasses can be derived.

In the Java programming language there is a class Classthat has important properties of a metaclass, for example it can create objects of other classes, but no more specific metaclasses can be derived from it.

Web links