public String getMessage (int numEggs) {
int a = numEggs/12;
int b = numEggs%12;
if ( numEggs < 0) {
System.out.println("Invalid number");
} else {
System.out.println("Your number of eggs is "+ a +" dozen(s) and "+ b+".");
return;
}
}
Type mismatch: cannot convert from int to String
そのため、リターンに何かを入れようとすると、取得し続けます。コードの何が問題になっていますか?getMessage (int numEggs)
与えられた質問の一部であるため、使用する必要があります。