Creates a new random number generator. Its seed is initialized to a value based on the current time:
public Random() { this(System.currentTimeMillis()); }
Two Random objects created within the same millisecond will have the same sequence of random numbers.
"I'm not back." - Bill Harding, Twister
There is no emoticon for what I am feeling!
the code you gave will generate a number in the interval [10,000-100,000],including the end points
Originally you mentioned a different interval?
do you know about java.util.UUID
There is no emoticon for what I am feeling!
Originally posted by H Melua:
i need to know the ID before i can insert it!
There is no emoticon for what I am feeling!
There is no emoticon for what I am feeling!
There is no emoticon for what I am feeling!
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
There is no emoticon for what I am feeling!