CodeGym doesn't even want to check the task, it crashes tons of bugs. anyone know why?
package pl.codegym.task.task13.task1319;
import java.io.*;
/*
Zapisywanie do pliku z konsoli
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
File plik = new File(reader.readLine());
FileWriter writer = new FileWriter(plik);
BufferedWriter bafed = new BufferedWriter(writer);
while (true){
String a = reader.readLine();
if (!a.equals("exit")){
bafed.write(a);
}else{
bafed.write(a);
break;
}
}
writer.close();
}catch (Exception e){ e.printStackTrace();}
// tutaj wpisz swój kod
}
}