集册 Java实例教程 将long原语转换为Long对象

将long原语转换为Long对象

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

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


public class Main {

 

  public static void main(String[] args) {/**来自 时 代 J a v a**/

    long i = 10;

   

    /*

    Use Long constructor to convert long primitive type to Long object.

    */

   

    Long lObj = new Long(i);

    System.out.println(lObj);

   

  }

}