Ask coding questions

← Back to all posts
using java.util.Scanner;
hackbot (1)

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?

Elizabeth11 (88)

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

hackbot (1)

does anyone know?