When using a Scanner object to read from a textfile, I want it to skip over the very first line in the file. How would I do achieve this?
Add the below code before the while loop to skip the first line.
while
if(file.hasNext()==true) { file.nextLine(); } else { System.out.println("Error: File is empty"); return null; }