As one may know, an object just allocated by the new
bytecode is not initialized, and is thus not a java.lang.Object
. If I do runtime bytecode manipulation and give that object to a method, the JVM will complain or even crash (because the "thing" I gave it is not a java.lang.Object
).
So, my question is, when are objects "fully" initialized, i.e. become a java.lang.Object
? Is that when the constructor (<init>
):
- is called?
- returns?
- some time before it returns?
- calls
java.lang.Object.<init>
? - some other timing?