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

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

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