The import java.util.Scanner conflicts with a file defined in the same file
java
Solution
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);
...
}
Problem
``` package scanner; import java.util.Scanner; public class Scanner { public static void main(String[] args) { Scanner input = new Scanner (System.in); String line = input.nextLine(); } } ``` Why am I getting an error message saying 'The import java.util.Scanner' conflicts with a file defined in the same file?