본문 바로가기

Software/JAVA

Converting a String to int/double/float

반응형

The following code snapshots :


String to int:

int i = Integer.valueOf( year ).intValue()




String to double:

int j = Double.valueOf( year ).doubleValue()




String to float:

int k = Float.valueOf( year ).floatValue()

 

 

출처 : http://home.tiscali.nl/~bmc88/java/sbook/025.html

반응형