public static String scores(ArrayList check){ String scores = ""; boolean flag = false; for(Dice a : check){ String tmp = ""; tmp += a.getNum(); for(int i = 0; i < scores.length(); i++){ if(scores.substring(i,i+1).equals(tmp)){ flag = true; } } scores += tmp + ","; } //System.out.println(scores.substring(0,scores.length()-1)); return scores; }