Skip to main content

Command Palette

Search for a command to run...

Stack Overflow

Published
1 min readView as Markdown
Stack Overflow

Introduction

  1. When we have any function at run time when its execution starts it gets loaded in the stack, as soon as its execution is over the method is taken out.
  2. In Java main is also a function.
  3. As all functions are loaded on the stack for their execution, the same main method is also loaded.
  4. The length of the stack is always fixed, if we try to execute it we will get a stack overflow error.
  5. When we make a call to main inside the main function, what will happen is we will get stack overflow error.
  6. Here what is happening is everytime when we also called main , like a recursive calls.
  7. Infinite number of recursive calls without a break will lead to stack overflow error.

More from this blog

Jeevan Henry Dsouza's team blog

23 posts