I have tried doing this but it always give of an error: unreported exception IO exception; must be caught or declared to be thrown. but then if I try putting a try catch in the write, newLine, flush, my main program would have the same error.
public Course(){
try{
fw = new FileWriter("Something.txt", true);
bWrite = new BufferedWriter(fw);
file = new File("Someting.txt");
scanner = new Scanner(file);
}catch(Exception e){}
}
public void setDetails(String cID, String cName)throws Exception{
write = cID + " || " + cName;
bWrite.write(write);
bWrite.newLine();
bWrite.flush();
}