Need example code for Random Numbers
Hi - can someone please give me an example code, I need to create random numbers and has to be unique everytime. It also needs to be 10 characters. Im thinking about using the current date and time but could'nt figure out. Maybe MMDDYYHHSS would work. Thanks all!
Re: Need example code for Random Numbers
int number = (int)(Math.random()*8999999999) + 1000000000;
errr, I just remembered you can't use an int for that high of a number.. try long.
[ 05-27-2004, 10:47 AM: Message edited by: cyblue ]