当前位置: 代码迷 >> Java相关 >> java读取txt有乱码!!求解决!!
  详细解决方案

java读取txt有乱码!!求解决!!

热度:102   发布时间:2011-04-04 14:09:13.0
java读取txt有乱码!!求解决!!
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
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();   
        }   
    }   
  
}  
读取的文件出来有乱码现象,求高手指教!!!谢谢!!
搜索更多相关的解决方案: null  java  

----------------解决方案--------------------------------------------------------
  相关解决方案