StackOverflowError

  • StackOverflowError is thrown when an application recurses too deeply, leading to a stack overflow.

  • It's a subclass of VirtualMachineError, indicating a serious issue with the Java Virtual Machine.

  • Two constructors are available: one with no detail message and one with a specified message.

  • It inherits methods from Throwable for handling and inspecting the error, including getStackTrace and getMessage.

public class StackOverflowError extends VirtualMachineError

Thrown when a stack overflow occurs because an application recurses too deeply.

Public Constructor Summary

StackOverflowError()
Constructs a StackOverflowError with no detail message.
StackOverflowError(String s)
Constructs a StackOverflowError with the specified detail message.

Inherited Method Summary

Public Constructors

public StackOverflowError ()

Constructs a StackOverflowError with no detail message.

public StackOverflowError (String s)

Constructs a StackOverflowError with the specified detail message.

Parameters
s the detail message.