These datatypes are useful to represent numbers with decimal point. For Example, 3.14, 0.0012, -123.11, etc. are called floating point numbers. These are again classified as float (Single precision floating point number) and double (Double precision floating point number).
Float datatype: In programming, any decimal or fractional value is called a float .If there is a decimal after the number, it will be classified as a float. In Java, a float is made up of 32-bits IEEE floating points*. If we have to assign float value then we must use or literal to specify that current value is Float.
Example: float x=2.321f;
Double datatype: Double is a data type that is twice the size of a float. I.e. it is made up of 64-bit IEEE floating points. In Java any value declared with decimal point is by default of type double. Default value is 0.0d. Double precision is actually faster than single precision on some modern processors that have been optimized for high-speed mathematical calculations. All transcendental math functions, such as sin( ), cos( ), and sqrt( ), return double values.
Example: double y=2.321;