Write code to convert Exception to String
import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static String toString(Exception e) { StringWriter s = new StringWriter(); e.printStackTrace(new PrintWriter(s)); return s.toString(); }/* w ww . j a va 2 s .c om*/ }