using java.util.Scanner;
hackbot (0)

Lately I've been trying to create that involves mostly user input. Yet, I can't ever seem to be able to load the java.util.Scanner file on repl. Can someone tell me how please?

You are viewing a single comment. View All
Elizabeth11 (20)

Here's an example that uses scanner.

Here are the steps:
1. Type this before the class main (first line in your code) import java.util.Scanner;
2. Then in your main code create a scanner (I called mine in)
Scanner name = new Scanner(;
3. Then use the .nextLine() to get string input and .nextInt() for integer input.

Please let me know if this helped or if you have any questions