Skip to content
Sharp

Engineering Interviews · interview question

In the context of JVM memory architecture, what is the primary role of the 'stack'?

Multiple choiceEasychapter-20-curatedpremiumengineering-interviewslive-coding-strategy
Choose one answer
Answer and explanation

Correct answer

B. Stores local variables and method calls

Why

The stack in JVM memory architecture is used to store local variables, method calls, and provides memory space for method execution. Each thread has its own stack, which allows for safe execution of methods concurrently.

Test yourself on Engineering Interviews

A free test with instant, explained results. No account needed.

Start free test
All Engineering Interviews questions →