Кто-нибудь может мне помочь? Это дает мне ошибку «Этот метод должен возвращать результат типа int».
public class Ship {
String type;
int model, level, playerHealth,
playerEnergy, playerSpeed, playerShield;
Ship(String type) {
this.type = type;
}
int getShipType() {
for(int i=1;i<4;i++)
{
if(type == "Sprites/ships/Ship"+i+".png")
return i;
}
}
}