what's inside an java object?# Java - 爪哇娇娃
f*e
1 楼
Coming from c++ world, I am confused :->
A c++ object contains all the data members and the vtable(if exists). The
methods are just like c function sitting somewhere, with the difference of
taking an addition hidden arguement(this). There is only one copy of each
method, which is shared by all the objects of the same class.
Is a java object the same? It's not clear to me, and I couldn't google the
right answer. The few java developers I asked, they seems not care about the
mechanics(typical ja
A c++ object contains all the data members and the vtable(if exists). The
methods are just like c function sitting somewhere, with the difference of
taking an addition hidden arguement(this). There is only one copy of each
method, which is shared by all the objects of the same class.
Is a java object the same? It's not clear to me, and I couldn't google the
right answer. The few java developers I asked, they seems not care about the
mechanics(typical ja