+ 1
Error: Bad operand '*' for binary . Why am I getting this
7 Respostas
+ 5
If you need to enter an integer value then use scanner.nextInt() and repeat Lesson 5.1.
double result = 6.28 * scanner.nextInt();
+ 4
Scanner is an object and you cannot multiply object with value
Take user input using scanner object then multiply that input with pi.
+ 4
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ but object names can also be considered variables am I right?
+ 3
Atulya Vaibhav Pandey
scanner is not a variable name it's an object of Scanner class.
I think you need to learn again about variable and object.
variable should have a type String, int, float or double.
+ 3
Rishi
Yes you can say but it would be a variables of non-primitive data type or user defined class.
Here are some differences between object and variable
https://www.sololearn.com/Discuss/416157/?ref=app
+ 2
scanner is my variable name in which I am taking input. Right? A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟