Where are the local variables of a running Java method held?
Correct answer B. In a frame on the JVM stack of the thread
Explanation
Each method invocation creates a new frame on the stack of the current thread, and the frame holds that call's local variables and operand stack. The frame disappears when the method completes. A local variable of a reference type stores only the reference in the frame, while the object it refers to lives on the heap.
Answer checked How we write and check questions
Discussion