I am learning Java (at the age of 15) and I am currently really stuck on a part of the code. I need to know how to write to a file within an array which is in a loop but I just cant get it write. I need it so that the user enters there own answer using a scanner. I need to do it without using Output Stream.
public static void modStudents() {
String[][] students = new String[12][4];
String output = "";
BufferedWriter writefile = null;
try {
for (int i = 0; i < 12; i++) {
writefile = new BufferedWriter(new FileWriter("StudentNames.txt"));
String content[] = output.split(",");
for (int j = 0; j < 3; j++) {
students[i][j] = content[j];
} catch (Exception e) {
System.out.println("Somethings gone wrong");
}