Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java implementation - Meta classes

Tags:

java

metaclass

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..

like image 952
Shmoopy Avatar asked Feb 18 '12 18:02

Shmoopy


1 Answers

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.

like image 149
Óscar López Avatar answered Sep 27 '22 23:09

Óscar López