In the pile are put the object's fields or methods also?


They say that the items are placed in the heap. This refers to fields or methods?
That is, for each object methods are generated, or all objects of the same type refer to the same methods?
March 19th 20 at 08:44
2 answers
March 19th 20 at 08:46
A bunch fit data.
Methods is not data.
March 19th 20 at 08:48
Bytecode methods contained in classes, classes in the metaspace, and metaspace is off-heap. The objects are ordinary sesnie structure that contains nothing except the values of fields and a 16-byte enterprises under the header. Maybe you will be interested in this answer.

Find more questions by tags Java