Java: Quick question about primitive data type long.
I have a variable of type long (primitive, so range is 2^63) called size.
I have the following code that is giving me an error: Code:
else if(size<=1099511627776) How do I overcome this problem? I tried placing the value I'm trying to compare into another long variable, but I can't assign the value 1099511627776 to it because I get the same error. Thanks for any guidance, vxc |
Use an L qualifier, I'm guessing it's treating the literal value as a normal int so:
Code:
else if( size<=1099511627776L ) |
Quote:
|
Thanks guys, it worked! Wasn't aware of the L qualifier. :)
|
All times are GMT -5. The time now is 08:17 AM. |