answersLogoWhite

0

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.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What are java kaywords?

if ,while,do , int ,float, for,switch,else,


What value is return by int main method?

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.


Why java is not a pure object oriented?

java is not purely oops because of primitive types in java like int and float double


Is this legal float f equals 2?

At least in Java, that's legal - 2 is treated as an int, which can be converted without problems to the float type.


What are the only types in Java that are not classes?

The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char


Write an expression that computes the sum of two variables in java?

int sum = a + b; PS: a and b are int variables that must have been already declared and initialized.


Eight basic data types used in java?

char, boolean, byte, short, int, long, double, or float


What are legal int literals 22 1.5 -1 2.3 10.0 5 -6875309 '7'?

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


A pointer to function which receives an int pointer and returns a float pointer?

float *(*funptr)(int *); float *fun (int *); funptr= fun;


What is a int in java?

int is integer which means datatype


Why the actual arguments declared as float is accepted only as double in formal arguments in java?

Sorry I don't Think I could Solve It


Is float is a keyword in java?

yes, float is keyword and data type in java