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

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

apache - setting document root in antoher partition on ubuntu -

python - pip install -U PySide error -