why?

作者在 2007-02-17 01:31:00 发布以下内容
import java.io.*;
import java.lang.String;
public class charApplication{
    public static void main(String[] args)
    {
        OutputStreamWriter osw = null;
        try{
            osw = new OutputStreamWriter(new FileOutputStream("D:/test.txt"),"Unicode");//这里<-----
        }
        catch (FileNotFoundException ex){
            System.out.println(ex);
        }
        try{
            osw.write("\u00A9\u00BD\u0391\u0392\u0393\u0394\u00f8");
            osw.flush();
        }
        catch(IOException ex){
            System.out.println(ex);
        }
    }
}

我编译时出现
charApplication.java:8: unreported exception java.io.UnsupportedEncodingException; must be caught or declared to be thrown
            osw = new OutputStreamWriter(new FileOutputStream("D:/test.txt"),"Unicode");
什么意思啊?
默认分类 | 阅读 1159 次
文章评论,共0条
游客请输入验证码
浏览40080次