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.
6 ответов
+ 1
Sin Extinguir use nextInt() for integer
+ 2
Use sc.nextLine();
+ 2
Yes you can
+ 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);
+ 1
thank you.. I will try it hope your day goes well
0
would you say anything about integers?