


我覺得不是程式碼的問題但還是一起貼上
import java.io.*;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author User
 */
public class WrapSyatemIn {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        // TODO code application logic here
        System.out.print("請輸入一串字");
        InputStreamReader ir=new InputStreamReader(System.in);
        
        char[] ch =new char[80];
        int i=0;
        while( (ch[i]=(char)ir.read())!=10)
            i++;
        
        System.out.print("用InputStreamReader讀到的是:");
        for(int j=0;j<i;j++)
            System.out.print(ch[j]);
     System.out.println();
     
     System.out.print("請再輸入一串字:");
     BufferedReader br=new  BufferedReader(ir);
     String str=br.readLine();
     System.out.println("用BufferedReader讀到的是:"+ str);
    }
}
謝謝各位大大
找到答案
無法顯示中文
http://jimmychanitpro.blogspot.com/2018/07/netbeans-utf-8.html
在C:\Program Files\NetBeans 8.1\etc\netbeans.conf
增加-J-Dfile.encoding=UTF-8
