This is my current class:
package Mathias;
import java.util.*;
public class Scanner {
public static void main(String args[]) {
System.out.print("What's your name?");
Scanner sc = new Scanner(System.in);
String Input = sc.nextLine();
System.out.println("Hello, " + Input + ".");
}
}
I get two errors on the 5th & 6th lines.
Error 1 http://puu.sh/64VGk.jpg
scthat you have defined. So change the class name or alternatively use complete package name for declaring variablescasjava.util.Scanner sc = new java.util.Scanner(System.in);