Are there float variables in Java, and if so, what are they???
herb slocomb
Ranch Hand
Joined: Feb 12, 2001
Posts: 1479
posted
0
32 bits, designated by F or f at end of literal : float x = 1.24F.
Brodie Patten
Greenhorn
Joined: Feb 28, 2001
Posts: 7
posted
0
Aren't there also Real variable? What's the difference between Real and Float?
herb slocomb
Ranch Hand
Joined: Feb 12, 2001
Posts: 1479
posted
0
no, there's Double which is 64 bits, and several integer types : int, short, long,byte, char.
Sri Bala
Ranch Hand
Joined: Mar 06, 2001
Posts: 63
posted
0
I want to add a point. By default, a number like 1.0 will be double in java. If you want a float. you have to specify 1.0f. so, float f = 1.0; // will not compile it should be float f = 1.0f;