>>752
static Number parse(String str) {
try { return Integer.valueOf(str); } catch (NumberFormatException e) {}
try { return Float.valueOf(str); } catch (NumberFormatException e) {}
throw new NumberFormatException();
}

System.out.println(parse("1").getClass()); //=> class java.lang.Integer
System.out.println(parse("1.0").getClass()); //=> class java.lang.Float

こうすればIntegerとFloatを区別してパースできる。

>>753
floatの精度知ってるの?
朝初心者は黙ってろ。