0

我在线程“main”java.lang.Error 中遇到异常:未解析的编译:在 FileTest.main(FileTest.java:39) 第 39 行是public static void main(String[] args){我做错了什么?

public class FileTest{
    public static void main(String[] args){

        try{
            String inFileName = args[0];
            String outFileName = args[1];
            BufferedReader ins= new BufferedReader(new FileReader(inFileName));
            BufferedReader con = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter outs = new PrintWriter(new FileWriter(outFileName));

            String first = ins.readLine(); //read from file
            while(first != null){
                System.out.print("Type in a word to follow " + first + ":");
                String second = con.readLine(); //read from console
                //append and write 
                outs.println(first+ ", " + second);
                first = ins.readLine(); //read from file
            }
            ins.close();
            outs.close();
        }
        catch (IOException ex){
            ex.printStackTrace(System.err);
            System.exit(1);
            }

        }
    }
}
4

1 回答 1

1

你的牙套似乎太多了。您可以删除最后一个}字符以使此代码编译。

于 2012-10-12T19:18:51.640 回答