Fırat Kıyak Fırat Kıyak - 1 year ago 65
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.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download