Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
1. Import the Scanner Class : import java.util.Scanner; 2. Create an object of the class : Scanner Obj = new Scanner(System.in); 3. Read user input : String userInput = Obj.nextLine(); Then the user input will be stored in "userInput" and you can use it in a condition, to display, ... I didn't get what you mean by "access to the other class". Hope this will help.
6th Sep 2019, 9:56 AM
Mark Abi Khalil
Mark Abi Khalil - avatar