开发者

Trouble creating a long

long timeStamp = 1312561140157; gives me an error saying that the litter is too large of type 开发者_如何转开发int

I know I can set a long to System.currentTimeMillis() and this number i used is an output from the currentTimeMillis().

Anyone know how to make a literal work when it is this big?


Use this long timeStamp = 1312561140157L. Just append L to the end of the number.


When you create a long you need put an 'L' character at the end of the number.

example: long timeStamp = 1312561140157L;

You can use lowercase or uppercase 'L', but generally you should use uppercase because l can be easily confused with 1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜