1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
/* Convert long primitive to Long object Example This example shows how a long primitive value can be converted to Long object */ public class longToLongExample { public static void main(String[] args) { long i = 10; /* Use Long constructor to convert long primitive type to Long object. */ Long lObj = new Long(i); System.out.println(lObj); } } /* Output of the program would be 10 */ |
Add Comment