int to long in java 8 code example Example: int to long java Long l= new Long(i); //first way Long l2=Long.valueOf(i); //second way