+ 6

What is easy way to take input in java? Plz explain me.

29th Dec 2016, 7:05 AM
Ajay Agrawal
Ajay Agrawal - avatar
3 Réponses
+ 3
I'll try both of your suggestions. Thank you for aid.
29th Dec 2016, 7:21 AM
Ajay Agrawal
Ajay Agrawal - avatar
+ 2
You simply can use Scanner object. Just initialize it with System.in stream. If you want to go the best way, you should use BufferedReader object. You need initialize once and it's ready to take input. Don't forget about exceptions!
29th Dec 2016, 7:15 AM
Dmitry Pudov
Dmitry Pudov - avatar
+ 1
Scanner sc=new Scanner(System.in); //where system.in will take input from the terminal
29th Dec 2016, 7:19 AM
Rajveer