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 short primitive to Short object Example This example shows how a short primitive value can be converted to Short object */ public class shortToShortExample { public static void main(String[] args) { short s = 10; /* Use Short constructor to convert short primitive type to Short object. */ Short sObj = new Short(s); System.out.println(sObj); } } /* Output of the program would be 10 */ |
Add Comment