ArrayList arrayList = new ArrayList();
for (File g : f.listFiles())
if (g.isFile())
{
arrayList.add(g);
}
I hope from the code above you can understand what Im trying to do. If a file is a file then add it to an arraylist. I dont know if this is the best one, its the one I know most. After adding it to an array, collection etc I would like to further process the files. But all I want help with is being able to extract the files from the list, eg all files that have equal size. So how can I go about this using my code as the basis? I done:
System.out.println (arrayList.toArray());
But that printed off some object references rather than filenames
So is arraylist not appropirate? and if so how can go about processing the files. eg listing all the files in the array that are equal in size