BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
in.readLine();

解决方案 »

  1.   

    请问用以下的字符串为什么不可以?
    char[] c=new char[50];
          int x=0;
          int n=0;
          while((x=System.in.read())!=-1){     //用字符数组暂存输入的字符         
             c[n]=(char)x;
             n++;
          }
          String in=String.valueOf(c).substring(1,n+1);//字符数组放在in这个字符串里