Why can't I assign a 'long' a value of 4 billion?

前端 未结 6 1456
情话喂你
情话喂你 2020-12-09 15:00

I\'m trying to declare a long value in Java, which unfortunately does not work.

This is my code. It results in the following error message: \"The literal 4294967296

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 15:37

    Soufiane is correct. Here is a doc that shows how to declare literals of the various types of numbers in Java:

    http://www.janeg.ca/scjp/lang/literals.html

提交回复
热议问题