Am using math.random()
method to generate random numbers. but i had a doubt about that method. math.random() is which algorithms will fallow to generate random
Here are 2 methods to Shuffle an Array:
Approach 1: Shuffle elements in an array
Approach 2: Java Collection.shuffle() method
And the method you use is one standard way accomplishing this.
There are 2 ways in java: java.util.Random and java.lang.Math.random. java.lang.Math.random() uses java.util.Random. It provides only doubles and has no seeding capability.