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