Java convert an int to a String
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
Written by Tombezlar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Java convert
Authors
Related Tags
#java convert
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#