Home  >  Q&A  >  body text

java - Scanner.scanner = new Scanner 报错,为什么?如何解决?

伊谢尔伦伊谢尔伦2764 days ago1298

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-04-17 17:40:51

    Scanner scanner

    reply
    0
  • 阿神

    阿神2017-04-17 17:40:51

    Don’t put dots behind Scanner.

            Scanner scanner=new Scanner(System.in);
            int in = scanner.nextInt();

    reply
    0
  • 阿神

    阿神2017-04-17 17:40:51

    There cannot be any dot after Scanner. What your code means is: new object.

    reply
    0
  • Cancelreply