Here are 3 ways to convert an int to a String
String s = String.valueOf(n);
String s = Integer.toString(n);
String s = "" + n;
I understand what we did for the first and second methods. But can someone please explain what does 3rd method do? In other words, how does "" convert integer into string?
Thanks
String s = String.valueOf(n);
String s = Integer.toString(n);
String s = "" + n;
I understand what we did for the first and second methods. But can someone please explain what does 3rd method do? In other words, how does "" convert integer into string?
Thanks