Basically my program lists data into a output file, and then I must then be able to read that output file as an input too in order to list the five most recent data. Here is my code:
case 2: options = "";
System.out.println("You have chosen to 'List recent data'"
+ "The five most recent data is: " + "\n");
String data1;
Scanner inFile2 = new Scanner (new FileReader ("Bankbalance.txt"));
for (int b=0; b<5; b++) {
data1 = inFile2.nextLine();
System.out.println(data1);
}
break;
Basically the output is giving the first five pieces of data, (I do realise this is because i'm asking it to count the first five) But im just wondering if its possible to display the most recent data instead?? (The data from the bottom of the text file rather than the top)