Hello,
I'm trying to use the BufferedWriter class to write files to a text file via an ArrayList of strings. Unfortunately I run into a compile-time error about not being able to resolve symbols. Is this a casting issue? Here's the snippet of code I have:
I'm trying to use the BufferedWriter class to write files to a text file via an ArrayList of strings. Unfortunately I run into a compile-time error about not being able to resolve symbols. Is this a casting issue? Here's the snippet of code I have:
Code:
FileWriter wr = new FileWriter(outFileName);
BufferedWriter outFile = new BufferedWriter (wr);
for(int i = 0; i < list.size(); i++)
{
outFile.write(list.get(i));
outFile.newLine();
}
[code]
I think the "get" method returns an object, but I need a string to make this work. Does anyone have any suggestions?
Thanks,
Jisoo22