Java implementation - Meta classes

Shmoopy picture Shmoopy · Feb 18, 2012 · Viewed 11.2k times · Source

The way I understand it, Java object model is 3 levels, each level describes the level beneath it, therefore there is one Meta class shared by all Classes (which are themselves objects?).

My question is - how are constructors implemented in Java? (or any other class methods) my logic says that constructors should appear in the Meta classes, but since there is only one Meta class, it doesn't make any sense that it keeps all possible constructors, or is my understanding of this is all wrong..

Answer

Óscar López picture Óscar López · Feb 18, 2012

In Java there's a single metaclass: the instances of the class Class are used to represent the types of classes and interfaces. The constructors are defined at the class level, not at the metaclass level.