Primitive Data Types - oracle doc says the range of long
in Java is -9,223,372,036,854,775,808
to 9,223,372,036,854,775,807
.
But when I do something like this in my eclipse
long i = 12345678910;
it shows me "The literal 12345678910 of type int is out of range
" error.
There are 2 questions.
1) How do I initialize the long
with the value 12345678910
?
2) Are all numeric literals by default of type int
?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…