Inheritance and Object creation, Theoretically and in Real

前端 未结 3 1082
庸人自扰
庸人自扰 2020-12-16 06:44

Lets say I have a class A.java,

\"enter

When I will execute a con

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-16 07:30

    JVM allocates memory for only one object (here D)

    1. memory allocation and initialization happens bottom(here D) to top(Object)
    2. initialization/calling constructors happens Top(Object) to Bottom(here D)

    reference :

    http://www.artima.com/designtechniques/initialization.html

提交回复
热议问题