개발

[JAVA] 형변환. String형에서 int, float형으로

말맹 2018. 11. 27. 09:48

int -> String


: Integer.toString(23);


float -> String 


: String s = Float.toString(25.0f);


String -> int 


: Integer.parseInt("1");


String -> float


: String s = "3.14";


float f = Float.parseFloat(s);