Reputation: 59
when i make somethink like this:
List<Player> gamers = JackpotGame.getUnsortedGamerList();
gamers = Collections.shuffle(gamers);
but i have error: http://scr.hu/1det/a13hi im sure that method getUnsortedGamerList return me List
Upvotes: 1
Views: 73
Reputation: 8387
shuffle
randomly permutes the specified list using a default source of randomness, and has no return.
Try to change this:
gamers = Collections.shuffle(gamers);
With:
Collections.shuffle(gamers);
Upvotes: 0
Reputation: 393771
change
gamers = Collections.shuffle(gamers);
to
Collections.shuffle(gamers);
shuffle
mutates the passed List
instance and has no return value.
Upvotes: 1
Reputation: 17132
Change
gamers = Collections.shuffle(gamers);
to
Collections.shuffle(gamers);
The static shuffle
method of the Collections class has a void
return type.
Upvotes: 0