A new frame is created each time a method is invoked. A frame is destroyed when its method invocation completes...
A frame is used to store data and partial results, as well as to perform dynamic linking, return values for methods, and dispatch exceptions.
Frames are allocated from the Java Virtual Machine stack of the thread creating the frame. Each frame has its own array of local variables , its own operand stack , and a reference to the run-time constant pool of the class of the current method.
In some of Oracle's implementations of the Java Virtual Machine, a reference to a class instance is a pointer to a handle that is itself a pair of pointers: one to a table containing the methods of the object and a pointer to the Class object that represents the type of the object, and the other to the memory allocated from the heap for the object data.
ok 这种情况确实是,虽然我没见过这段代码,不过可以看出在这段代码还是 new 了一个 Test()类才实现的调用x. (而且,这里面相当于是调用了 Test.class中的代码 得到的x) ,那么不就是说,这段代码的实现是在有了一个 Test()类对象的情况下才实现的吗?那不就是说其实final int x 的生命周期是小于Test()类对象的,也就是说上面的final修饰的代码没有延长x的生命周期。
那我们试想这样一个情况,也是我们讨论的情况,如果final被定义在局部的话,我们怎么得到这个x (这个x的生命周期是不是就是在所包含的{}局部内呢)?