Skip to main content

The strange problem with datatype long of java in eclipse! Please help me.

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2012-04-08
Points: 0

As i know, the long has length is 64 bits, range from "9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. But in eclipse, when i type "long a = 9999999999" (10 digits), editor of eclipse displays errors at this line, why?

Untitled.jpg52.67 KB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-22
Points: 0

Even though assigned to a long, 9999999999 is still an integer literal. If you write 9999999999L instrad it should work.