Multiple Inputs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Multiple Inputs

public class Program { public static void main(String[] args) { String word = "howdy"; for(int i = word.length()-1;i >= 0;i--){ System.out.print(word.charAt(i)); } } } For the String word. It asks for many strings to take the place of this variable on CodeCoach sololearn. I was wondering if I could create one variable that will have all the test inputs run through it. Note: the program works as intended, I just need help figuring out sololearn’s multiple test input system.

8th Jun 2021, 7:27 PM
Cesar Saavedra
4 Answers
+ 2
I think you already completed this lesson of taking user input in Java.. here you can find details... Just create Scanner class object and use appropriate method .. If you mean here how to multiple input here, then just give all required inputs for code in pop up by space separated or in new line in required order at a time in pop-up box.. it's not an interactive. edit: Cesar Saavedra this explains how solo learn input console works... https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
8th Jun 2021, 7:37 PM
Jayakrishna 🇮🇳
+ 1
Thank you, the scanner worked for the program Code Used: Scanner input = new Scanner(System.in); String word = input.next();
8th Jun 2021, 7:46 PM
Cesar Saavedra
0
Yes. That works perfectly.. Here you can find other types input methods also like for int input, double,.. https://www.sololearn.com/learning/2220/ You're welcome...
8th Jun 2021, 7:49 PM
Jayakrishna 🇮🇳
0
Instead of looking for parameters passed to main(), look for keyboard input after the program starts. SoloLearn passes all your input as if entered from the keyboard, not to the command line.
8th Jun 2021, 8:49 PM
Jerry Hobby
Jerry Hobby - avatar