0

I have a problem where the text file outputted here doesn't make a new line each time. I guess \n isn't the right thing to use?

    BufferedWriter out = new BufferedWriter(new FileWriter(id + ".txt"));
        out.write(" ID: "+ id);
        out.write("\n Name: "+ name);
        out.write("\n Date of Birth: "+ dateOfBirth);
        out.write("\n Address:"+ address);
        out.write("\n Phone Number: "+ phoneNumber);
        out.write("\n Licence Number: "+ licenceNumber);
        out.write("\n Age: "+ age);
        out.write("\n Licence Experation Date: "+ licenceExperationDate);

    out.close();
Mark
  • 1

0 Answers0