StackOverflowError : Thrown when a stack overflow occurs because an application recurses too deeply.
OutOfMemoryError : Thrown when the Java Virtual Machine cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.