Why am I getting this error for this code? I have the correct imports for ArrayList an Collections
private ArrayList tips; public TipsTask(ArrayLi
You should call it like this:
private ArrayList tips; public TipsTask(ArrayList tips){ this.tips = tips; Collections.shuffle(tips); }
Collections.shuffle(tips) modifies the ArrayList directly. It does not need to create a copy.