集册 Java实例教程 将整数转换为字符串

将整数转换为字符串

欢马劈雪     最近更新时间:2020-01-02 10:19:05

580
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将整数转换为字符串

 /*nowjava.com - 时代Java*/

public class Main {

 

  public static void main(String[] args) {

    Integer intObj = new Integer(10);

   

    //use toString method of Integer class to convert Integer into String.

    String str = intObj.toString();

    System.out.println("Integer converted to String as " + str);

  }

}