float Java Keyword

float is a Java primitive type.

A float variable may store a single-precision floating point value.

Examples

  float ratio = .01;
  float diameter = 6.15;
  float height = 1.35E03;  // 1.35 * 103 or 1350.0
  float height = 1e-2;  // 1.0 * 10-2 or 0.01
  

Remarks

The following rules apply to this keyword's use:

Related Topics

double Java Keyword