java读取txt有乱码!!求解决!!
import import
import
import
import
public class Daone {
public static void main(String[] args) {
File file = new File("www.txt");
try {
FileReader f = new FileReader(file);
BufferedReader reader = new BufferedReader(f);
String str = reader.readLine();
while (str != null) {
System.out.println(str);
str = reader.readLine();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
读取的文件出来有乱码现象,求高手指教!!!谢谢!!