I recently installed Eclipse on a new computer and when I tried to write this code it gave me this error. I swear that I've written this type of
Scanner keyboard = new Scanner(System.in)
many of times in my old computer and have never gotten this error until now.
import java.util.Scanner;
public class W1M1 {
public static void main(String[] args) {
System.out.println("Hellow World");
Scanner keyboard = new Scanner(System.in); //'keyboard' word shows this error
System.out.println("Please enter your name: ");
String userInput = keyboard.nextLine();
System.out.println("Hello there, " + userInput + ".");
}
}