0
Stuck on java operators.
Hi guys, I need a little help. What was my mistake? "Bad operand type for binary operator *" error. import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double pi = 3.14; //your code double rad = scanner * 2 * pi; System.out.println(rad); } }
3 Answers
+ 1
To get a double value from the user, you should use scanner.nextDouble() instead of scanner.
https://www.sololearn.com/learn/Java/2220/
0
Now I understand. Thank you for your help, big brother.
0
Java has Math.PI