This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Declare a Long value

 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm attempting to store a long value in a variable using the code
long hope = 991909000000
However because this value is greater thant the maximum for an integer I get the error integer number too large

The funny thing is I can delare the variable to be = System.currentTimeMillis()
which is greater than the max integer value

I'm using the J2ME Wireless Toolkit version 2.2

Am I missing something?

Frank
 
Paul Clapham
Sheriff
Posts: 21567
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The usual way to declare a long literal in Java isNote the "L" at the end.
 
Frank Daly
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Paul.

Frank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic