In Java, you can use either a float or a double
THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type
The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char
it is the same as an int, String, or any of the others:float myVar = 5.7f;If you try to assign a decimal number you must place an "f" at the end, otherwise Java will assume you are trying to assign a double.
In C float a[8]; In Java float a[] = new float[8];
In Java, you can use either a float or a double
java is not purely oops because of primitive types in java like int and float double
with help of type casting it is possible
THIS IS FOR JAVA i don't know about anything about other languages yes it can be assignedthe syntax is:int (number) = (float) numberFOR EXAMPLE:int = a;a = (float ) 5.5;if the (float) is not there then in Java it gives an error saying precision loss of data type
float and double are types of numbers that accept decimals. Consider them as numbers in scientific notation. double allows a larger range of numbers than float, and more significant digits. Usually you would use double, unless you have some special situation, like a large array of numbers, and you decide the extra precision is not necessary.
yes, float is keyword and data type in java
The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char
char, boolean, byte, short, int, long, double, or float
it is the same as an int, String, or any of the others:float myVar = 5.7f;If you try to assign a decimal number you must place an "f" at the end, otherwise Java will assume you are trying to assign a double.
Sorry I don't Think I could Solve It
Floating point types are used to represent fractional numbers. In both C and Java the names for these types are float and double. double offers greater precision than float.
In C float a[8]; In Java float a[] = new float[8];