java - Integer literals -


i can't understand why in java can assign float value double value ,for example :

float number=456.7f; 

but can't same integers , float numbers, such :

int numb=56798434l; 

in c++ these things seem work.

you cannot assign value of type higher capacity type of lower capacity without casting. long can store larger numbers, can't assigned int.


Comments

Popular posts from this blog

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -

apache - setting document root in antoher partition on ubuntu -

java - Updating to mongo 3.0 -