입력 받는 방법이 문제였습니다~!
null 체크를 해줘야하네용 ㅎㅎ
public void main() throws IOException { Tree tree = new Tree(); String s = ""; while (true) { s = inputString(); if (s == null) break; if (s.length() <= 0) break; tree.addData(Integer.parseInt(s)); } tree.printPostorder(); }
wjdeh515 2년 전
null pointer 오류가 발생하는데 뭐가 문제인지 잘 모르겠습니다. ㅠㅠ
입력 받는 방법이 잘못된 걸까요?