---
title: "What Is Stack?"  
description: "What Is Stack?"  
author: "Anonymous User"  
published: 2015-07-03  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/2674/what-is-stack  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# What Is Stack?

1.Each Java thread have a private JVM stack, created along with thread.2.Stack stores frames. Frames are used for storing data (Variable and Object Data as well as partial results) and to perform operations such as: a.Dynamic linking b.Dispatch exceptions when error occurs c.Return values when methods are invoked. Since the stack can't be accessed directly, it push and pop frames.3.It is not mandatory that the Java virtual machine stack had to be continuous.4.JVM throws StackOverflowError, if any computation inside a thread needs larger JVM stack than allocated

## Answers

### Answer by Anonymous User

1.Each Java thread have a private JVM stack, created along with thread.2.Stack stores frames. Frames are used for storing data (Variable and Object Data as well as partial results) and to perform operations such as: a.Dynamic linking b.Dispatch exceptions when error occurs c.Return values when methods are invoked. Since the stack can't be accessed directly, it push and pop frames.3.It is not mandatory that the Java virtual machine stack had to be continuous.4.JVM throws StackOverflowError, if any computation inside a thread needs larger JVM stack than allocated


---

Original Source: https://www.mindstick.com/interview/2674/what-is-stack

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
