l am trying to store string values in an ArrayList and then print them to a file but my code is showing some errors of cannot find symbol. Where have l gone wrong. The following is my code.
import java.io.File;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Arrays{
public static void main(String[] args)throws IOException
{
File f = new File("C:\\Users\\Administrator\\Documents\\java code\\Arrays.txt");
FileWriter fw = new FileWriter(f,true);
PrintWriter pw = new PrintWriter(fw);
ArrayList<String> header = new ArrayList<>(Arrays.asList("NAME","REGNUM","ACADEMICYEAR","PROGRAMME","COURSECODE","ASS1","ASS2","ASS3","TEST1","AGGREGATEDMARK","COURSEWORK","GRADE","RESULT"));
pw.print(header);
pw.close();
}
}