Tip:
Highlight text to annotate it
X
Hi! My name is Joseph.
In this Java 7 video tutorial you will learn about floating-point types.
Floating-point data types, known as real numbers, are float and double.
Float type, called single-precision, provides a precision of 6-7 digits and occupies 32 bits in computer memory to store a value.
Double type, called double precision, provides a precision 14-15 digits and occupies 64 bits in computer memory to store a value.
Float variables are useful when using fractions or decimal numbers, but do not require a high degree of accuracy.
Double type variables are useful when performing iterative calculations or high values are handled , and the degree of accuracy is very important.
The result of the program code.
Declaring variables of type double.
Variable initialization r of double type, representing the radius.
Variable initialization pi of double type, representing the constant PI.
Expression that calculates the area of a circle, and the result is assigned to a variable a.
Display the message between quotes and the value of variable a.
Thank you for participating in this video tutorial.