데이터 타입별 형변환 방법
문자 -> 숫자 String str_num = "1234"; //String to Int int int_num1 = Integer.parseInt(str_num); //String -> Int int int_num2 = Integer.valueOf(str_num); //String -> Int //String to Double, Float double double_num = Double.valueOf(str_num); //String -> Double float float_num = Float.valueOf(str_num); //String -> Float //String to Long, Short long long_num = Long.valueOf(str_num); //String -> Long sho..
Language/Java
2021. 2. 22. 12:59