import *;
public class Ex_Exception2{
public static void main(String[] args) throws IOException{
//int c;
BufferedReader stdIn =
new BufferedReader(new InputStreamReader(System.in));
PrintWriter stdErr =
new PrintWriter(new PrintWriter(System.out,true));
stdErr.print("请输入汉字:-> ");
stdErr.flush();
String line = stdIn.readLine();
byte[] bytes = line.getBytes();
stdErr.println("其机内码为:");
for(int i=0; i < bytes.length; i++){
System.out.print(bytes[i]+ "
");
}
System.out.println();
}
}
这样应该也可以