What do I write to receive the input in coding coach? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What do I write to receive the input in coding coach?

I'm new to Sololearn and pretty new to coding in general. I have gone through the introductory Java tutorial and would like to start doing the games like coding coach to implement what I have (hopefully) learned. My first challenge is knowing what to code to receive the input from coding coach. For example: how to I receive the input string in the challenge that has animals in the night?

31st Dec 2019, 3:17 PM
Mark Chapin
4 Answers
+ 1
In Java, you can use Scanner class to take input. You can read further about Scanner here. https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/util/Scanner.html Below is an example. import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); //….. } }
31st Dec 2019, 4:14 PM
r1c5
r1c5 - avatar
0
I'm such a newb I don't know how to do that. How do I take the input in any program?
31st Dec 2019, 3:48 PM
Mark Chapin
0
I mean come on Mark Chapin , java is the only course that you have completed on sololearn and yet do not know how to take user input. Kindly revisit the course if you have not touched it for a long time. https://www.sololearn.com/learn/Java/2220/
31st Dec 2019, 4:56 PM
Avinesh
Avinesh - avatar
0
Thank you, gentlemen.
31st Dec 2019, 6:19 PM
Mark Chapin