0
Can you find errors
Import java.util.Scanner; Public class PrintNumber { Int value; Int value2; Public void printProduct(); { scanner input = new Scanner(System.in); System.out.println("enter first integer"); Value =input.nextInt(); System.out.println("enter second integer"); Value2 =input.nextInt(); Input.close(); } Public String addString(Int x, Int y) { Int product = x*y; Return String.format(" the product of the two integers is %d", product ); } }
1 ответ
+ 1
java is case sensitive...
and you had a semicolon in the wrong place
import java.util.Scanner;
public class PrintNumber {
int value;
int value2;
public void printProduct(){
Scanner input = new Scanner(System.in);
System.out.println("enter first integer");
value = input.nextInt();
System.out.println("enter second integer");
value2 = input.nextInt();
input.close();
}
public String addString(int x, int y) {
int product = x * y;
return String.format(" the product of the two integers is %d", product);
}
}