Primitive Data Types in Java – Float
Primitive data types are very important in any language. Without this data types we can not understand programming language. We can also called primary data types in java. In this primitive data types we found four types of family like Integer, Float, Character and Boolean. And these families have their own children like Integer [byte, short, int and long], Float [float, double], Character [char] and Boolean [Boolean].
In this blog we will discuss on Float Family:
Float Data Type
|1||float||4 byte||More than Integer|
|2||double||8 byte||More than float|
|3||long double||10 byte||Maximum in Java|
Program in Float Data Types:
Title: Primary Data Type – Float
public static void main(String args)
//float f1 = (float)67.78; // Cast this value into double
float f1 = 67.78f; // Cast this value into double
System.out.println(“F1 = ” + f1);
double d1 = 67.89;
System.out.println(“D1 = ” + d1);
Video available on YouTube
Tutorial – Try Yourself
Tutorial – 1 : Find the area of circle.
Tutorial – 2 : Find sum and average of 6 numbers.
If you have problem on this blog, you can directly comment or subscribe.
Share and Enjoy
747total visits,2visits today