public static void p7_1 () throws FileNotFoundException {
        boolean track = false;
        while(!track) {
            try {
                String filename = "hello.txt";
                PrintWriter write = new PrintWriter(filename);

                try {
                    write.println("Hello World!");
                } finally {
                    write.close();
                }
            } catch (FileNotFoundException exception) {
                System.out.println(exception.getMessage());
            }
            track = true;
        }

        try {
            String filename = "hello.txt";
            File infile = new File(filename);
            Scanner in = new Scanner(infile);
            try {
                while (in.hasNextLine()) {
                    System.out.println(in.hasNext());
                }
            } finally {
                in.close();
            }
        }
        catch(FileNotFoundException exception){
            System.out.println(exception.getMessage());
        }
        catch(NoSuchElementException exception){
            System.out.println(exception.getMessage());
        }
    }