Convert Short to primitive data type


public class Main {

  public static void main(String[] args) {
    Short sObj = new Short("10");

    byte b = sObj.byteValue();
    System.out.println(b);

    short s = sObj.shortValue();
    System.out.println(s);

    int i = sObj.intValue();
    System.out.println(i);

    float f = sObj.floatValue();
    System.out.println(f);

    double d = sObj.doubleValue();
    System.out.println(d);

    long l = sObj.longValue();
    System.out.println(l);
  }
}

Output:


10
10
10
10.0
10.0
10
Home 
  Java Book 
    Runnable examples  

Data Type Short:
  1. Create Short from short value
  2. Convert Short to primitive data type
  3. Convert short to String
  4. Convert String to short primitive
  5. Min and Max values of short
  6. short overflow