+ 4

What is the difference between int and double in java

14th Sep 2017, 6:40 AM
Ronald
Ronald - avatar
6 Answers
+ 9
Int is integers, no decimal behind Double has decimal behind
14th Sep 2017, 6:42 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 6
addition to @ vengat Int is whole numbers while double is floating point numbers
14th Sep 2017, 10:51 AM
P R
P R - avatar
+ 2
int 12 double 1.2
14th Sep 2017, 7:52 PM
D_Stark
D_Stark - avatar
+ 2
int as we know is an integer. Integers are a set discrete numbers ranging from negative values to positive, meaning they cant contain decimal places where as double represents a set of continuous numbers, also ranging from positive to negative but this time with decimals. For example; 5 is an int and 5.2 is a double value.
14th Sep 2017, 11:33 PM
Amos Aidoo
Amos Aidoo - avatar
+ 1
thx
14th Sep 2017, 6:42 AM
Ronald
Ronald - avatar
0
int is a 32 bit data type which can be used to store integer. double is 64 bit data type used to store floating point numbers that is numbers which has something after decimal point.
14th Sep 2017, 3:26 PM
shobhit
shobhit - avatar