1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | try { throw new Exception('예외처리'); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); // str에 스택트레이스를 저장 String str = sw.toString(); try { if (sw != null) { sw.flush(); sw.close() } if (pw != null) { pw.flush(); pw.close(); } } catch (IOException e1) {} } | cs |
번호 | 제목 | 날짜 | 조회 |
---|---|---|---|
89 | 객체지향의기초 객체지향이란 | 06.25 | 331 |
92 | [자바] 자바 스프링 프로젝트 폴더 구성 | 06.28 | 532 |
105 | 자바 StackTrace를 String 형으로 저장하기 | 12.08 | 334 |
106 | 자바 Thread.sleep vs TimeUnit.sleep 무엇이 더 나을까 | 12.08 | 343 |