Glorified classes in the Java language

前端 未结 13 1809
一生所求
一生所求 2021-01-29 20:32

Some classes in the standard Java API are treated slightly different from other classes. I\'m talking about those classes that couldn\'t be implemented without special support f

相关标签:
13条回答
  • 2021-01-29 21:14

    Most of those classes isn't really implemented with 'special' help from the compiler or JVM. Object does register some natives which poke around the internal JVM structures, but you can do that for your own classes as well. (I admit this is subject to semantics, "calls a native defined in the JVM" can be considered as special JVM support.)

    What /is/ special is the behaviour of the 'new', and 'throw' instructions in how they initialise these internal structures.

    Annotations and numbers are pretty much all-out freaky though.

    0 讨论(0)
提交回复
热议问题