package class7_3_WritingTextFiles_start; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; import java.io.Writer; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Scanner; public class CarWriter { public static void main(String[] args) { System.out.println("This [will be] a command-line car processor. (For offline " + "simulation)"); Scanner in = new Scanner(System.in); System.out.print("Filename: "); String filename = in.nextLine(); try(Scanner fileScanner = new Scanner(Paths.get(filename))) { // etc. } catch (FileNotFoundException e) { System.out.println("Could not open the file: "+filename); } catch (IOException e) { System.out.println("Error while reading file: "+filename); } } }