What\'s the difference between StackOverflowError and OutOfMemoryError and how to avoid them in application?
There are two(2) areas in memory the heap and stack.
If there is no memory left in stack for storing function call or local variable, JVM will throw java.lang.StackOverFlowError,
while if there is no more heap space for creating object, JVM will throw java.lang.OutOfMemoryError: