Wrapper class Wrapping and Unwrapping example 2

Java Programming Language / OOPs concept more

26676

Program:

 public class WrappingUnwrapping {

   public static void main(String args[]) {
      Integer x = 15;

      // Returns byte primitive data type
      System.out.println( x.byteValue() );

      // Returns double primitive data type
      System.out.println(x.doubleValue());

      // Returns long primitive data type
      System.out.println( x.longValue() );
   }
}

Output:

15
15.0
15
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.