Its telling me I need a return statement on the last line of my method even though that part can never be executed.. I am a novice at Java and I am teaching myself.. so is it just me that has bad coding style or is the java compiler a bit too OCD?
public static String translate(String[] sourceLanguage, String[] destinationLanguage, String toBeTranslated)
{
for (int i = 0; i < (sourceLanguage.length); i++)
{
if (toBeTranslated.equals(sourceLanguage[i]))
return (destinationLanguage[i]);
}
return ("?????");
}
Please don't post on /prog/ anymore (and remember to email all your posts to sage for the quickest answers!). Thanks!