Fırat Kıyak Fırat Kıyak - 9 months ago 39
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.

Answer Source

You may use streams for that.

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