Practice mode Java

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.