Cannot make a static reference to the non-static method



  • int b = new Scanner(System.in).nextInt(); 
    

    Eckles gives me this kind of thing:

    Cannot make a static reference to the non-static method close() from the type Scanner.



  • The static method belongs to the class, not the static method belongs to the class install.

    When you're calling. close()You're making a mistake because this method is not associated with a class instas.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2