集册 Java实例教程 将Long对象转换为String

将Long对象转换为String

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

594
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将Long对象转换为String

 

public class Main {

 /*时代Java 提供*/

  public static void main(String[] args) {

    Long lObj = new Long(10);

   

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

    String str = lObj.toString();

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

  }

}