0

can I use user input in java???

I have been trying to use scanner for user input but I cannot use them in operators like <,=,>. Can I do something so that I can use the user input in java? I would be very thankful if you help me.

25th Apr 2020, 5:31 AM
Anirban Bora
Anirban Bora - avatar
6 ответов
+ 1
Sin Extinguir use nextInt() for integer
25th Apr 2020, 5:40 AM
A͢J
A͢J - avatar
+ 2
Use sc.nextLine();
25th Apr 2020, 7:27 AM
Souptik Nath
Souptik Nath - avatar
+ 2
Yes you can
26th Apr 2020, 1:47 PM
JS Pro
JS Pro - avatar
+ 1
Sin Extinguir You can read character using Scanner like this. We can also read <,=,> Scanner sc = new Scanner(System.in); char s = sc.next().charAt(0); System.out.println(s);
25th Apr 2020, 5:37 AM
A͢J
A͢J - avatar
+ 1
thank you.. I will try it hope your day goes well
25th Apr 2020, 5:41 AM
Anirban Bora
Anirban Bora - avatar
0
would you say anything about integers?
25th Apr 2020, 5:38 AM
Anirban Bora
Anirban Bora - avatar