Fırat Kıyak Fırat Kıyak - 7 months ago 32
Java Question

What is the most efficent way to generate unique double values in Java

There are methods such as searching for duplicates but I wonder if there is a better solution for this task.


You may use streams for that.

double[] array = new Random().doubles()
                             .limit(500) // How many you want.