The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.lang  [58 examples] > Numbers  [2 examples]

e82. Converting a String to a Number

    byte b = Byte.parseByte("123");
    short s = Short.parseShort("123");
    int i = Integer.parseInt("123");
    long l = Long.parseLong("123");
    float f = Float.parseFloat("123.4");
    double d = Double.parseDouble("123.4e10");

 Related Examples
e83. Parsing and Formatting a Number into Binary, Octal, and Hexadecimal

See also: Arrays    Assertions    Classes    Commands    Objects    Strings    System Properties    Threads   


© 2002 Addison-Wesley.