Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
- /*
- * Convert Float to float primitive example. Program to convert Java
- * Float object to float primitive data type.
- */
- public class FloatToFloatPrimitive {
- public static void main(String args[]){
- //new Float object
- Float fObj = new Float("2.124");
- //to convert Float to float use floatValue method of Float wrapper class
- float f = fObj.floatValue();
- System.out.println("Float converted to float: " + f);
- }
- }

Post new comment