Division of numbers
I could see in Timesta开发者_运维技巧mp class, the constructor goes like:
public Timestamp(long time) {
super((time/1000)*1000);
....................
What Im not understanding is, what is the need of dividing the time by 1000 and then multiplying again by 1000. What difference will it make? Isn't this piece redundant?
That's a way of truncating to the next lower multiple of 1000 milliseconds -- i.e., to the whole second. It's not necessarily the best way, but it's a way.
精彩评论