Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 970 Bytes

File metadata and controls

14 lines (10 loc) · 970 Bytes

Class pointer

First 8 bytes (in 64-bits environment) of an object are reserved for header. Next 8 bytes also have special meaning - they contain pointer to the Klass. It is a native object that represents every class loaded by JVM. It is mirrored by Java implementation - java.lang.Class.

In general methods in Java are virtual. It means that actual method to execute is resolved only in runtime. Replacing class pointer in object will result in invoking methods implemented in replaced class - Replace class example. Of course it may cause throwing exception or even halting JVM, especially if switched classes have different set of methods. Replace class with custom method example

Back: Object's header Next: Fields

Up: Readme