Double
Double precision, as indicates by the double keyword will use 64 bits to store a value. A Double precision is really faster than single precision on some modern processors which have been optimized for high speed mathematical calculations. Whole transcendental math functions, such as sin (), cos() , and sqrt(), return double values. Whenever you required to manage accuracy over several interative calculations, or are manipulating huge values numbers, double is the finest choice.
Here is a short program which uses double variables to compute the area of a circle:
// Compute the area of a circle.
class Area {
public static void main (String args [ ] ) {
double pi, r, a ;
r = 10.8; // radius of circle
pi = 3.1416; // pi, approximately
a = pi * r * r; // compute area
system.out.println ("Area of circle is" a) ;
}
}