How to convert primitive float to Float object in Java

1 Answer

0 votes
package javaapplication1;

public class JavaApplication1 {
 
    public static void main(String[] args) {
  
        float f = 3.14f;

        Float fObj = f;
        System.out.println(fObj);
    }
}
 
/*
    
run:

3.14

*/

 



answered Nov 4, 2016 by avibootz

Related questions

1 answer 146 views
1 answer 238 views
1 answer 216 views
1 answer 233 views
1 answer 209 views
...