Because float is used for storing floating point numbers (values with decimal points and fractions) whereas int is used to store integer numbers (whole number)
Storing a float in a int will result in loss of data which is not desirable and hence it is not done.
if ,while,do , int ,float, for,switch,else,
1. A method declared as "int" returns an int value. 2. The main() method in Java is not declared as "int", but as "void", meaning it returns no value.
java is not purely oops because of primitive types in java like int and float double
At least in Java, that's legal - 2 is treated as an int, which can be converted without problems to the float type.
The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char
int sum = a + b; PS: a and b are int variables that must have been already declared and initialized.
char, boolean, byte, short, int, long, double, or float
Java ints can be any whole number between 2147483647 and -2147483648 22 int 1.5 (illegal as it's a float) -1 int 2.3 (illegal as it's a float) 10.0 (illegal as it's a float) 5 int -6875309 int '7' is a legal int, but it won't be a seven, but the decimal ASCII equivalent (assumes a single character in apostrophes is a char). '7' is 55
float *(*funptr)(int *); float *fun (int *); funptr= fun;
int is integer which means datatype
Sorry I don't Think I could Solve It
yes, float is keyword and data type in java