Can anyone give an idea of why the code is not working? the problem is in the participating countries[numCountries]=newCountry;
I'm not sure why he continues to say that type mismatch cannot convert Country[]to a country, but I thought mine countries[numCountries]had a type Country[]since I already called it in the second line of code like this type?
public class World{
private Country[] countries;
private int numCountries=0;
public boolean addCountry(Country[] newCountry){
if(!(newCountry==null)){
countries[numCountries]=newCountry;
numCountries++;
return true;
}
else
return false;
}
}
source
share