Saturday, April 4, 2015

Get error from exception

Get error from exception


try {
    String a = null;
    Integer.parseInt(a);
} catch (Exception e) {
    StringWriter stack = new StringWriter();
    e.printStackTrace(new PrintWriter(stack));
    System.out.println(stack.toString());
        
}

No comments:

Post a Comment