[Java] 문자열(String), 숫자(int, double, float, long, short) 형변환
String ---> int, double, float, long, short String str = "1234"; int n = Integer.parseInt(str); int n = Integer.valueOf(str); double n = Double.parseDouble(str); double n = Double.valueOf(str); float n = Float.parseFloat(str); float n = Float.valueOf(str); long n = Long.parseLong(str); long n = Long.valueOf(str); short n = Short.parseShort(str); short n = Short.valueOf(str); int, double, float, ..