Even better...

long myvalue = 1021888800000000002l; // add the lowercase letter L to the
end

Steve.

-----Original Message-----
From: Chen, Gin [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 3:39 PM
To: [EMAIL PROTECTED]
Subject: Re: assigning a value to a long type variable


This is not an issue with the long but rather the actual number you wrote
in.
Try this instead

long myvalue = Long.parseLong("1021888800000000002");

-Tim

-----Original Message-----
From: Benoit Jodoin [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 21, 2003 2:52 PM
To: [EMAIL PROTECTED]
Subject: assigning a value to a long type variable


I know it might sound like a weird/simple question...but here's my
problem :

that's what im trying to do

long myvalue = 1021888800000000002;
this value is way smaller than Long.MAX_VALUE...

here's the compilation error i get at runtime:

Integer literal out of range.  Decimal
int literals must be in the range -2147483648 to 2147483647.
long myvalue = 1021888800000000002;
               ^

there must be a way to do it?

Regards

Ben




--
Benoit Jodoin <[EMAIL PROTECTED]>
Vertical 7

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

 http://java.sun.com/products/jsp
 http://archives.java.sun.com/jsp-interest.html
 http://forums.java.sun.com
 http://www.jspinsider.com

Reply via email to