1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
/* Java float Example This Java Example shows how to declare and use Java primitive float variable inside a java class. */ import java.util.*; public class JavaFloatExample { public static void main(String[] args) { /* * float is 32 bit single precision type and used when fractional precision * calculation is required. * * Declare float varibale as below * * float <variable name> = <default value>; * * here assigning default value is optional. */ float f = 10.4f; System.out.println("Value of float variable f is :" + f); } } /* Output would be Value of float variable f is :10.4 */ |
using float statement give problem and answer codes