Where does the system store parameters and local variables whenever a method is invoked?

Java MCQ: Where does the system store parameters and local variables whenever a method is invoked?

a) Stack
b) Heap
c) Array
d) LinkedList

Answer:

a) Stack

Explanation:

In Java, parameters and local variables are stored in the stack memory whenever a method is invoked. The stack memory is used for execution of a thread and for method invocations.

Reference links:

https://www.rameshfadatare.com/learn-java-programming/
https://www.javaguides.net/p/java-tutorial-learn-java-programming.html

Leave a Comment

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

Scroll to Top