+ 1
Can anyone help me with how i take the input from user in Java?
As a beginner in java, i know how to print any text by System.out.println.. can anyone help me with how i take the input from user?
4 RĂ©ponses
+ 2
Rupendra Pratap Singh Tomar if you had just continued with the tutorial eventually you would have been thaught that. Patience is the key
+ 3
Firstly, you import the Scanner with
import java.util.Scanner
 Secondly, you create an input object for the Scanner
 Scanner input = new Scanner();
Â
 Thirdly, you ask for the input with which every data type. I will use int as an example.
 System.out.println("How old are you?");
 input number = input.nextInt();
+ 3
Using Scanner.