What is the easiest way to convert the result of Throwable.getStackTrace() to a string that depicts the stacktrace?
Throwable.getStackTrace()
The solution is to convert the stackTrace of array to string data type. See the following example:
import java.util.Arrays; try{ }catch(Exception ex){ String stack = Arrays.toString(ex.getStackTrace()); System.out.println("stack "+ stack); }