I'm wondering about how objects are represented in memory, and how the supertype portions of an object are actually organized and related, under the hood of the JVM.
If A extends Object and B extends A, and we execute: new B(), does this amount to the JVM making an Object instance, an A instance (with only members of A itself), and a B instance (with only members of B itself), and then linking them all together somehow ultimately to make a new B object including all members of B and its supertypes? I'm aware at least that constructor calls are chained in order of inheritance.
Could you also clarify how typecasting references is integrated with the representation of objects in memory?
And how does this work for abstract classes and interfaces as supertypes?
What I described above is basically how I picture it for myself when coding, but I'd like to know about how this is actually implemented in memory by the JVM. I realize I may have some misconceptions here, so feel free to correct me where necessary. Thanks!