50,527
社区成员
发帖
与我相关
我的任务
分享
package scannertext;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.*;
public class Test2{
public static void main(String[]args){
String s;
String[][]save=new String[100][100];
String median =new String("some");
try{
BufferedReader in =new BufferedReader(new FileReader("e:/abc.txt"));
int i=0;
while((s=in.readLine())!=null){
save[i]=s.split(" ");
i++;
}
System.out.println(median.equals(save[0][0]));
}
catch(FileNotFoundException e){
e.printStackTrace();
}
catch(IOException e){
e.printStackTrace();
}
}
}
http://jingyan.baidu.com/album/2009576193ee38cb0721b416.html?picindex=1
上看到一个帖子,我也在preferences的workplace下设置Text file encoding 为UTF-8,可输出结果还是乱码,经测试英文是可以的。