0
I’m having a hard time creating percentage-related goals.
What I want to do is a method that generates objects, all objects have only one attribute.
I need that 20% of the objects are generated with this attribute having as value 1 and the others having as value 2, however, I need it in a way that in my ArrayQueue
those with a value of 1 and 2 are not necessarily positioned on one side of the other.
20% deterministic or random?
– Oralista de Sistemas
deterministic!
– leonardokbruksch
"don’t necessarily be positioned next to each other" by chance means adding objects to an array and shuffling them (
Collections.shuffle()
)?– Piovezan