Int type String in JAVA transfer There are three methods

  1. String.valueOf(i)
  2. Integer.toString(i)
  3. i+""

 

 

i + "" is an int constant. + The empty string, this involves some basic knowledge of string, string type + int he would go to such understanding is a string in java to keep up with the type of string type int i represents the string (first i is converted to string), int + string type is of type int i first string is then converted back to keep the string

 

 

Original: https: //blog.csdn.net/rocling/article/details/82818505

Guess you like

Origin www.cnblogs.com/peachh/p/12080554.html