How would you test Scanner input in Java?
Tanisi90

So I am new to Replit. I am trying to make a test that test input from the keyboard and then a final print statement. However, my test keeps getting stuck at the first Print statement I ask. Even though my output is correct. Just curious on how to go about testing Scanner input?

So like:

System.out.println("What is your name?");
String name = input.nextLine();

How do I get it to recognize both the statement and the return?

Any help is appreciated. Thanks in advance!

You are viewing a single comment. View All
codingjlu

@Tanisi90 hmm... not sure I know what you mean. Is it that you don't want duplicate names?