Why we use in specifically srand() in random algorithms in java? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 2

Why we use in specifically srand() in random algorithms in java?

26th Feb 2017, 11:29 AM
Sameeraja Bharathula
1 ответ
+ 8
It generates a random seed string, and it's useful for making unique values - could possibly return same number repeatedly unless you do something like this to change it where target is the seed. double randomGenerator() { return target.nextDouble()*0.5; }
26th Feb 2017, 11:42 AM
Mark Foxx
Mark Foxx - avatar