728x90 iNT1 [Java 봐] Type casting(형 변환) 문자열 ↔ 숫자String to intint Integer.parseInt(String s) public class String2int { public static void main(String args[]) { String s = "12345"; int n = Integer.parseInt(s); System.out.println("n = " + n); }} Output n = 12345int Integer.valueOf(String s) public class String2int { public static void main(String args[]) { String s = "12345"; int n = Intege.. 2024. 6. 2. 이전 1 다음 728x90