Sometimes we need to generate random numbers to identify an entity uniquely.
We can generate random number very easily by the below code:
/**
*
* @return a random confirmation code.
*/
public int generateIntRandomNumber()
{
Random generator = new Random();
int i = generator.nextInt(999999999);
return i;
}
0 Comment(s)