Java weirdness

Posts: 2331
Joined: 2006-05-20

I type:

private static final long myVariable = 0x0000000100000000;

Compiler says the number is too large! WTF?!?!

-----

Posts: 1381
Joined: 2006-05-20

Try

private static final long myVariable = 0x0000000100000000L;

(note the "L" at the end.)

-----

There's a thin line between genius and insanity - where's my eraser?



erica057's picture
Posts: 2331
Joined: 2006-05-20

tww1fa wrote:
Try

private static final long myVariable = 0x0000000100000000L;

(note the "L" at the end.)

I knew you wouldn't let me down :D

-----