0
Is it possible?
i have a doubt is it possible to use operators in getting input . i tried but the output is not getting https://code.sololearn.com/c9mV2Wt3kJ1u/?ref=app what is mistakes i did in this code
6 Antworten
0
you can not, x is an object of Scanner class, you can use methods that are available in that class
x + = 2;
Incompatible types.
Required: java.util.Scanner
Found: int
https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
0
"Required:java.until.Scanner"
is thos i have to add in my coding
0
no, this is an error message, you are trying to add the number 2 (int) to x (java.util.Scanner class) it is not possible,
0
k thx bro
0
you can save it, e.g.
System.out.print (x.nextInt () + 2);
or
int number = x.nextInt ();
System.out.print (number);
0
Thank u daneil
i got it
https://code.sololearn.com/ccKFy1VFjCQN/?ref=app