Mega Code Archive

 
Categories / Java Tutorial / Data Type
 

Use Float constructor to convert float primitive type to a Float object

public class Main {   public static void main(String[] args) {     float f = 10.56f;     Float fObj = new Float(f);     System.out.println(fObj);   } }