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
精彩评论