I am trying to make my statement appear in new lines when I open up the text file, I used the "\n" but no luck. My code is below:
try {
FileWriter ac = new FileWriter("D:\\programming\\Java\\JavaBanking\\Transactions.txt",true);
BufferedWriter fw = new BufferedWriter(ac);
fw.write("You have chosen the following amount:" + String.valueOf(amount)+ "\n" + " the number:" + getNumber() + "Is the chosen number"
);
fw.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Right now it just appears in a long line, how can I make the information appear in in new a line ?