try {
dataFile = args[0];
}
catch (Exception e) {
System.out.println("The file was not found. Please input file name now: ");
dataFile = scan.nextLine();
}
This gets a file name from the command line, and if no file is specified it asks the user to input a file name, however, it only asks once. If no valid file name is inputted it produces an error message. What code should I use to loop this so it will repeatedly ask the user to input a file until he/she inputs a valid file name?