Java에서 String을 int로 변환하거나, int를 String으로 변환해야하는 상황이 자주 발생하지만,그 때마다 찾아보기 귀찮아 글로 남겨 정리한다.1. String을 int로 변환하기Integer.parseInt() 사용String str = "123";int number = Integer.parseInt(str);System.out.println(number); // 123Integer.parseInt()는 String을 int로 변환하는 가장 일반적인 방법변환할 문자열이 숫자가 아니면 NumberFormatException이 발생 Integer.valueOf() 사용String str = "123";int number = Integer.valueOf(str); // Integer 객체 -> ..