Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1994

Java convert an Int to a String

$
0
0
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

Viewing all articles
Browse latest Browse all 1994

Trending Articles