Online Java Compiler By
JavaTpoint.com
public class ShortFloatValueExample3 { public static void main(String[] args) { // assigning value to short short x=35; //these old style is now deprecated Short y=new Short(x); // floatValue() returns float value of Short double fValue = y.floatValue(); // printing float value System.out.println("Returned float value of Short is = " + fValue); } }
Output