I am trying with below code to generate 10 digits unique random number. As per my req i have to create around 5000 unique numbers(ids). This is not working as expected. It a
this is for random number starting from 1 and 2 (10 digits).
public int gen() { Random r = new Random(System.currentTimeMillis()); return 1000000000 + r.nextInt(2000000000); }
hopefully it works.