Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

The operator * is undefined for the argument

$
0
0
Hello, I'm new to this website, and new to programming.
I'm trying to write a simple code that will multiply height and width(Excuse my English, It's not my native language)
But I'm getting the error "The operator * is undefined for the argument"
Here's my code
import java.util.Scanner;
class Calc {

	public static void main(String args[]){
		
		
		double answer;
		System.out.println(" enter width");
		Scanner width1 = new Scanner(System.in);
		
		System.out.println("enter height");
			Scanner height1 = new Scanner(System.in);	
			answer = height1 * width1;
			
			
	}
}


Any suggestions?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>