‫In the previous video, we learn about the real numbers in Java.
‫In this video, we'll learn about the decimal numbers.
‫In Java, there are two data types that can store decimal numbers in Java, which are the float and
‫the double.
‫Let's start with the float.
‫The float data type is a 32 bit single procession floating point number.
‫It can store decimal numbers with sufficient procession for most purposes.
‫To define a float number, we should add F capital or small at the end of the number.
‫Let's start by the float keyword.
‫I'll name it as pi pi.
‫This is the float, I name it as pi and I'll give it a value.
‫3.14.
‫If I end with the semicolon, I have an error.
‫I should end with f capital or small.
‫This is how we define the float in Java.
‫The second data type is double.
‫The double data type is a 64 bit double precision floating point number.
‫It can store decimal numbers with higher procession compared to float.
‫It's the most commonly used data type for decimal numbers in Java, for example.
‫To create a double, we start with the double keyword and I'll name it as Pi two because I can't name
‫it as Pi because I created Pi before, so I'll name it as Pi two.
‫And here I specify the pi value, which is more.
‫Precisely.
‫I don't need to end with D or any letter for double like float.
‫And this is how we create the double, which is more and and more precise and with higher procession
‫compared to float.