Proud Japanese
2011-08-09 12:28:36 UTC
Hello,
I see that there are two ways to parse command line arguments. For
example,
double d1 = Double.valueOf(args[0]).doubleValue() ;
double d2 = Double.parseDouble(args[0]);
Is there a difference between these two options? Personally I think
that the second option is simpler.
Which one is more preferable?
Do both of these options [i.e. Type.valueOf(args[i]).TypeValue() &
Type.parseType(args[i])] work with all of Java's eight basic data
types [i.e.character, boolean, byte, short, integer, long, float &
double]
Regards,
Hayato
I see that there are two ways to parse command line arguments. For
example,
double d1 = Double.valueOf(args[0]).doubleValue() ;
double d2 = Double.parseDouble(args[0]);
Is there a difference between these two options? Personally I think
that the second option is simpler.
Which one is more preferable?
Do both of these options [i.e. Type.valueOf(args[i]).TypeValue() &
Type.parseType(args[i])] work with all of Java's eight basic data
types [i.e.character, boolean, byte, short, integer, long, float &
double]
Regards,
Hayato