Napisałem prosty skaner:
Scanner skaner1 = new Scanner(System.in);
System.out.println("Strzelaj");
skaner1.nextLine();
String wynik = portal1.sprawdz(skaner1);
i metodę która odbiera argument:
public String sprawdz(String Pole)
{
int strzal = Integer.parseInt(Pole);
String wynik = "Pudło";
for(int pole : Polozenie)
if(strzal == pole)
{
wynik = "Trafiony";
iloscTrafien++;
break;
}
if(iloscTrafien == Polozenie.length)
{
wynik = "Zatopiony";
}
System.out.println(wynik);
return wynik;
}
Ale wyrzuca mi błąd
The method sprawdz(String) in the type Portal is not applicable for the arguments (Scanner)
Gdzie popełniam błąd