I get an error message cannot convert from String to Movie. Why do I get this error message what should I be returning in the first if statement. Should I call the class Movie?
public Movie findMovieByName(String inTitle) {
for (Movie movies : movieArray)
if (inTitle == movies.getTitle())
return movies.getTitle();
else
return null;
inTitle.equals(movies.getTitle())instead.Movie, not aString- also, if the first movie in your array does not match, you are going to return null, which is probably not what you need.moviesinstead ofmovies.getTitle()