@@ -0,0 +1,1010 @@
+package com.wsn.chapter18javaio;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.util.LinkedList;%0A%0A/**%0A * Created by power on 2017/8/11,011.%0A */%0A%0Apublic class Practise10 %7B%0A%0A    LinkedList%3CString%3E list = new LinkedList%3C%3E();%0A%0A    // Throw exceptions to console:%0A    public void read(String filename) throws IOException %7B%0A        // Reading input by lines:%0A        BufferedReader in = new BufferedReader(new FileReader(filename));%0A        String s;%0A        while ((s = in.readLine()) != null)%0A            list.add(s);%0A        in.close();%0A    %7D%0A    public void show() %7B%0A        while (list.size()%3E0)%7B%0A            if (list.getLast().contains(%22Practise10%22))%0A                System.out.print(list.getLast() + %22%5Cn%22);%0A            list.removeLast();%0A        %7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) throws IOException %7B%0A        Practise10 p = new Practise10();%0A        if (args.length%3E0)%7B%0A            p.read(args%5B0%5D);%0A            p.show();%0A        %7D%0A    %7D%0A%7D%0A

完成练习18.10