by Ron Zucker
data type3 |
range3 |
string to object |
string to type1 |
object to type2 |
type to object (constructors) |
type to string |
boolean |
true or false |
valueOf( s )
|
getBoolean( s ) |
booleanValue() |
Boolean(boolean_value) |
valueOf(type) |
char |
'\u0000' - '\uFFFF' ISO Unicode character set |
Character(charAt(int)) |
charAt(int) |
charValue() |
Character(char value) |
|
byte |
-128 - 127 |
|
parseByte(s)* |
byteValue()* |
|
|
short |
-32768 - 32767 |
|
parseShort(s)* |
shortValue()* |
|
|
int |
-2,147,483,648 -
|
valueOf( s )
|
parseInt( s) |
intValue() |
Integer(int value) |
|
long |
-9,223,372,036,854,775,808 -
|
valueOf( s )
|
parseLong( s) |
longValue() |
Long(long value) |
|
float |
-3.40292347+E38-3.40292347+E38 |
valueOf( s )
|
parseFloat(s)* |
floatValue() |
Float(float value) |
|
double |
-1.79769313486231570E308-
|
valueOf( s ) Double( s ) |
parseDouble(s)* |
doubleValue() |
Double(double value) |
All
of this was necesssary because there are no string to type methods for type
float.
3. Java
How to Program, Dietel & Dietel, Prentice Hall, 1997, page 95