What do you think about the following line of code?:
String s= "10.0";
float f = Float.valueOf(s).floatValue();//1
Is it necessary? Why would it be better using such a syntax rather than using:
float f = Float.valueOf(s);//2
It still gives the same results taking advantage of the autoboxing function.
In short my question is: Why should one choose for the first syntax instead of the second one? Are they completely the same?