使用BufferedReader输入数据得到的也是缺少第一个字符?

解决方案 »

  1.   

    String s;
    try
    {
        BufferedReader bd=new BufferedReader(new InputStreamReader(System.in));
        s=in.readLine()
        System.println(s):
    }
    这样写是不会有问题的。
      

  2.   

    import java.io.*;
    public class ReadFromKB
    {
        public static void main(String args[])
        {
        try{
    byte bArray[]=new byte[40];
    String str;
    System.out.println("Enter something Using Keyborad:");
    int c=System.in.read(bArray); 
    str = new String(bArray);
    System.out.print("You entered:");
    System.out.println(str);
           }
           catch(IOException ioe)
           {
    System.out.println(ioe);
           } 
        }
    }我觉得搂住的程序肯定是没问题,我的程序跟楼主的差不多,我在我的机器上调试是正确的,
    如果楼主调试得还是不正确得话,那我只能怀疑是VJ++的编译问题了,另外说一下,VJ++不是纯正的java
      

  3.   

    vj++已经没下一版了
    淘汰了
    .net 用j#
    赶快换工具!