我有一个问题,这里输出的文本文件每次都不会换行。我猜\ n是不是正确的用法?
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();