I have a program made in JAVA that shows in console a txt file that contains a list of words sorted alphabetically:
try{
FileReader fr = new FileReader("archivo.txt");
BufferedReader br = new BufferedReader(fr);
String [] file = {"archivo.txt"};
ArrayList<String> fileList =new ArrayList<String>(Arrays.asList(file));
String cadena;
while((cadena=br.readLine())!=null){
System.out.println(""+cadena);
}
}catch(Exception e){ }
}
}
I need that when you save them in a ArrayList
you mess up, and show them like this in console. I tried with:
Collections.shuffle(arrayList);
And nothing, what do you suggest?