console()方法在哪个包和类中,在我下载的jdk中的lang包中的System类中找不到这个方法?   是不是版本问题,这个方法变成了什么?

解决方案 »

  1.   

    System.arraycopy()?
    还是ArrayList等的clone()?
      

  2.   

    程序原代码:public class Test3 {
    public static void main(String[] args) {
    String src = System.console().readLine();
    int i = Integer.parseInt(src);//This method will give the failed reason.
    String aim = "";
    while (i > 1) {
    aim = i % 2 + aim;
    i /= 2;
    }
    aim = i+aim;
    System.out.println(aim);
    }
    }
      

  3.   

    console
    public static Console console()Returns the unique Console object associated with the current Java virtual machine, if any. Returns:
    The system console, if any, otherwise null.
    Since: 
    1.6 jdk1.6才支持!