+ 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?
5 Respostas
+ 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();
//…..
}
}
0
I'm such a newb I don't know how to do that. How do I take the input in any program?
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/
0
Thank you, gentlemen.