Example:
Input File Content: public Class Test{ int c(int a); } Input n: 2 Output: int c(int a); }
n lines from the end.
1. Make use of BufferedReader
object to read through the contents of the input file and store it in a list
.
2. Return last n
values from this list as an output.
public static ArrayList<String> tailFile(File file, int numberOfLines) throws IOException { }
C
Java
Python