C
Craig Lister
I'm a newbie..
I'm trying to list all files in a directory, and store them in a aFile
object. As I iterate through each file, I store the size, name, path, date
etc...
How do I store them once the object is created? I thought they would simply
be added to an ArrayList, but this doesn't seem to be working.
eg:
for each file {
myFile afile = new myFile();
afile.name=...
...
ArrayList.add (aFile);
}
But this seems to store the same object in all the array slots....
How should this be done?
I'm trying to list all files in a directory, and store them in a aFile
object. As I iterate through each file, I store the size, name, path, date
etc...
How do I store them once the object is created? I thought they would simply
be added to an ArrayList, but this doesn't seem to be working.
eg:
for each file {
myFile afile = new myFile();
afile.name=...
...
ArrayList.add (aFile);
}
But this seems to store the same object in all the array slots....
How should this be done?