i am making a game which will ask different questions in java. questions are stored in some arraylist.
My problem is that these questions should not be repeated. and if all questions has been asked then program should stop. i have used java random function. but it is failed . any help will be appreciable
Regards
i am making a game which will ask different questions in java. questions are
Share
Copy list of questions to a temporary list, and
This loops as long as list has elements, pulling a random element out and then removes it from list.
edit for clarification – this ensures you don’t get duplicates