Home > DeveloperSection > Interviews > What Is Stack?

Posted on    July-03-2015 12:11 AM

 Java Java 
 1 Answer(s)
  499  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Posted on    July-03-2015 12:11 AM

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 

Don't want to miss updates? Please click the below button!

Follow MindStick