converting (2) 썸네일형 리스트형 각종 변수간 변환 Dealing with nullsUtilFactory.convertNull Java – comparing stringsUse == for primitive data types like intIf (mystring == null) Use the equals() method to compare objectsUse .equals for strings : if (a.equals(“cat”)) Java - Converting int to string String myString = Integer.toString(my int value) or String str = "" + i Java - Converting String to int int i = Integer.parseInt(str); orint i = Inte.. 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 이전 1 다음