When i want import scanner class in my project eclipse show me some errore :
Exception in thread \"main\" java.lang.Error: Unresolved compilati
You should give class name as different then API classes of Java.So just change class name from Scanner to ScannerProgram.
import java.util.Scanner;
public class ScannerProgram {
public static void main(String[] args) {
Scanner myScanner = new Scanner(System.in);
System.out.println(myScanner.nextLine());
}
}