[求助]why?
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");
什么意思啊?