- 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.
- ~The JVM doc
复制代码 你自己猜测的其实是不正确的.
局部变量是必须加final的,而数据成员则不必要.
至于为何必须加final,这与java语言自身有关系,java本身就是有某些缺陷的,它也在不断改进自己半吊子的窘境.
不过,您是有富有想象力的人! |