I am using java.util.random with a seed(new Random(System.currentTimeMillis())
- I need to convert this to a int(my business logic)
- I tried using the .nextInt(), but it doesn't help
//my business logic--Below code is in a loop and is intended to generate a different random number each time//
int randomNumber=(int) Math.floor(inputParam1 * (new Random(System.currentTimeMillis())).nextInt()));
Expected Ouput:A new random number to be generated each time, in int format
Actual Output:
- with nextInt() it is generating the same number each time
- without converting to Int, I am not able to use the 'Random'
datatype with my int variable shown above