I can convert an integer into string using
String s = "" + 4; // correct, but poor style
or
String u = Integer.toString(4); // this is good
I can convert a double into string using
String s = "" + 4.5; // correct, but poor style
or
String u = Double.toString(4.5); // this is good
I can use String s = "" + data
approach to convert either an int or double into String. While If I wants to use the other approach using toString()
I have to use the Wrapper class of each data type. Then why in some books it is mentioned that the first approach is poor one while the second one is the better. Which one is the better approach and why?