Float

float:

  • The float data type is a single-precision 32-bit IEEE 754 floating point.
  • Float is mainly used to save memory in large arrays of floating point numbers.
  • Default value is 0.0f.
  • The float data type is never used for precise values such as currency.
  • Example: float f1 = 234.5f

double:

  • The double data type is a double-precision 64-bit IEEE 754 floating point.
  • This data type is generally used as the default data type for decimal values.
  • The double data type should never be used for precise values such as currency.
  • The default value is 0.0d.
  • Example: double d1 = 123.4

Next: Boolean