Beginner here. Need some deeper insight. Four integer types: byte
, short
, int
, and long
. So, apart from their range, what should I know about their behavior.
Difference between int i = 1000 ;
and long l = 1000 ;
By differences, I mean, the space allocated in the memory, speed when using them etc. Any thing, that I must keep in mind while designing an algorithm in real life.
In one line, why use int
if long
can do int
and more than int
.
Searched on internet but didn't find a precise answer.