Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile error Enum

 
Lorenzo Tagliaferro
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm trying to compile a simple enum:



I receive 1 error:


Elaborator.java:5: integer number too large: 9223372036854775797
Num1(9223372036854775797),
^
1 error


I don't understand why!!

Thanks!

 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 20
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Joanne! :-)

I solvedt!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic