O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

The StackWalker class has four variants of the static factory method, getInstance(), which are different only in their ability to take one of the following several options or no options at all:

  • StackWalker getInstance(): This is configured to skip all the hidden frames and no caller class reference.
  • StackWalker getInstance(StackWalker.Option option): This creates an instance with the given option, specifying the stack frame information it can access.
  • StackWalker getInstance(Set<StackWalker.Option> options): This creates an instance with the given set of options, specifying the stack frame information it can access. If the given set is empty, the instance is configured exactly like an instance of StackWalker getInstance().

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required