Throwable t = new Throwable(); // test code
final Writer result = new StringWriter();
final PrintWriter printWriter = new PrintWriter(result);
t.printStackTrace(printWriter);
result.toString();
You need to create an account or log in to post comments to this site.