Your own class is named Scanner
and you are importing another class named Scanner
. This means the compiler does not know which Scanner
class you mean when you create a variable of type Scanner
.
Try to rename your class to something else.
Alternatively you could use java.util.Scanner
this way without renaming your own class:
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
...
}