This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Compile error Enum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Compile error Enum" Watch "Compile error Enum" New topic

Compile error Enum

Lorenzo Tagliaferro

Joined: Jun 15, 2009
Posts: 20

Hi all,

I'm trying to compile a simple enum:

I receive 1 error: integer number too large: 9223372036854775797
1 error

I don't understand why!!


Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
Non floating point numeric literals in Java are considered to be integers and that number is too large to be an integer. If you want it to be considered a long put L on the end

Note - always use a capital L for this as a lowercase l might be mistaken for the digit 1.

Lorenzo Tagliaferro

Joined: Jun 15, 2009
Posts: 20

Thank you Joanne! :-)

I solvedt!!
It is sorta covered in the JavaRanch Style Guide.
subject: Compile error Enum
It's not a secret anymore!