Posts: 266
Threads: 239
Joined: Apr 2011
area = (float) (3.14 * radious * radious);
sir plz tell me about this statment. what function of float and how to use.why u use.
Posts: 9,583
Threads: 8,089
Joined: Apr 2011
float is a java’s native data type it is used to save the values with the decimal.
In this line of code we are telling the compiler that convert the result of the calculation to float and save in the area. This is called type casting in simple words Type Casting refers to changing an entity of one datatype into another.