Is unboxking expensive that it's better avoiding it? From this java tutorial:
public class ValueOfDemo {
public static void main(String[] args) {
// this program requires two
// arguments on the command line
if (args.length == 2) {
// convert strings to numbers
float a = (Float.valueOf(args[0])).floatValue();
float b = (Float.valueOf(args[1])).floatValue();
Why don't they just leave it like float a = (Float.valueOf(args[0]));
? If they introduced the diamond operator in order to save time to programmers, why would not they make use of the unboxing function? Is it less expensive doing it manually like they do?
Thanks in advance.