java.lang.Double.shortValue()


java.lang.Double.shortValue()

package com.codingdict;



import java.lang.*;



public class DoubleDemo {



   public static void main(String[] args) {



      /* returns the double value represented by this object

         converted to type short */

      Double obj = new Double("3.5");

      short s = obj.shortValue();

      System.out.println("Value = " + s);



      obj = new Double("2");

      s = obj.shortValue();

      System.out.println("Value = " + s);

   }

}