the simple way to read from user in java .. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

the simple way to read from user in java ..

i want to take the data from the user in the simple way , i know there are many ways but i want to know the simplest one .. if u know please help me

1st Oct 2017, 12:25 PM
uzair rashid
uzair rashid - avatar
1 Answer
+ 2
Scanner scanner = new Scanner (System.in); int i = scanner.nextInt (); String s = scanner.nextLine(); //also: .next () etc.
1st Oct 2017, 12:31 PM
Jonas Schröter
Jonas Schröter - avatar