java.lang.Float.shortValue()


java.lang.Float.shortValue()

package com.codingdict;



import java.lang.*;



public class FloatDemo {



   public static void main(String[] args) {



      /* returns the float value represented by this object

         converted to type short */

      Float obj = new Float("6.52");

      short s = obj.shortValue();

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



      obj = new Float("5");

      s = obj.shortValue();

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

   }

}