Convert float Primitive Value to Float Object - Java Language Basics

Java examples for Language Basics:float

Description

Convert float Primitive Value to Float Object

Demo Code


public class Main {
 
  public static void main(String[] args) {
    float f = 1.5f;
   // w  w w .  j a  v  a  2  s.  c  om
    Float fObj = new Float(f);
    System.out.println(fObj);
 
  }
}

Result


Related Tutorials