import java.io.*;public class Test {    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(reader.readLine());
        int b = Integer.parseInt(reader.readLine());
int c = Integer.parseInt(reader.readLine());
int d = Integer.parseInt(reader.readLine());        System.out.println("a = " + a + ", b = " + b + " c = " + c + ", d = " + d );
    }}这个程序一看就明了吧!执行正确! 再看下一个片段:import java.io.*;public class Cmp{    private int[] number;    public Cmp(){
number = new int[10];
    }    public void Input(){
System.out.println("Please input 10 numbers, using ENTER KEY isolation a number until complish.\n"
+"enter ESC KEY express quit. ");            BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
for(int i=0; i<10; i++){
    int buffer = 0;
    try{ 
buffer=Integer.parseInt(reader.readLine());
    }catch(IOException e){}
    number[i] = buffer;
}    }    public void Print(){
System.out.println("hee ");
for(int i = 0; i<10; i++)
    System.out.println(number[i]+" ");
    }    public static void main(String args[]) throws Exception{
Cmp cmp = new Cmp();
cmp.Input();
System.out.println("hee1 ");
System.out.println("hee2 ");
cmp.Print();
System.out.println("hee3 ");

    }
}输出结果很离奇,只有hee3能输出,请问问题出在哪了,谢谢!

解决方案 »

  1.   

    Please input 10 numbers, using ENTER KEY isolation a number until complish.
    enter ESC KEY express quit.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    hee1
    hee2
    hee
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    hee3
    Press any key to continue...
      

  2.   

    我的运行结果是
    12
    12
    12
    12
    a = 12, b = 12 c = 12, d = 12
      

  3.   

    我的运行结果是
    12
    12
    12
    12
    a = 12, b = 12 c = 12, d = 12
      

  4.   

    Please input 10 numbers, using ENTER KEY isolation a number until complish.
    enter ESC KEY express quit. 
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    hee1 
    hee2 
    hee 









    10 
    hee3 
    俩的运行结果还不一样

      

  5.   

    问题已经解决了,好象是JDK的问题,具体什么问题我也不知道,反正我重装了下就OK了,运行正常。yitianyidian所运行的结果我不知道是怎么出来的,我这能得到正确结果,你可以在试试。在最后感谢jsjboss的热心关注!