I am trying to get the user to enter their name and have it be printed out on java using Sublime Text 3. After the user enters their name when a message prompts them for it, their name is supposed to be printed out but it justs skips over to a new blank line. It works on online compilers but not on Sublime. How do I get user console input to work on Java Sublime Text 3?
import java.util.Scanner;
public class SocSecProcessor {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter name: ");
String name = input.nextLine();
input.close();
System.out.println(name);
}
}