Class.class.isInstance(Class.class)

614 단어 Java

Class.class.isInstance(Class.class) // true

This means that the [color=red]class object for Class is an instance of itself[/color].
In Java, all objects have an instantiating class, and all classes are objects. With-
out the circular dependency, the system must support an infinite tower of class
objects, each one an instance of the one above it. Instead, Java uses this circularity to solve this problem.
diagram:
[img]http://dl.iteye.com/upload/attachment/0076/0356/c09a74b3-0098-3552-bccd-3b550ff8b4ba.bmp[/img]
《Java Reflection in Action》

좋은 웹페이지 즐겨찾기