BigDecimal bd = new BigDecimal("3.14159265359"); float f = bd.floatValue(); System.out.println(f);In this example, a BigDecimal object is created with the value "3.14159265359". The floatValue() method is then called on this object and the resulting float value is stored in the variable "f". Finally, the value of "f" is printed to the console, which should be approximately 3.1415927. This example is part of the java.math package library.