How can I print to the console the name of the method in which the exception was thrown?

  • 0
    The entire call stack is printed using printStackTrace. And how to display only the name of the method in which the exception was thrown to the console?
    Java Norah McGrath, Aug 25, 2019

  • 1 Answers
  • 0
    exception.getStackTrace () [0] .getMethodName ()
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!