Both local variables mt & md are of float data-type. It means they possibly have a fractional part which isn't zero!
Rather than use the imprecise float, try the safer int out:
Rather than use the imprecise float, try the safer int out:
final Movie myFilm = myMovies[myMoviesIndex]; final int mt = round( myFilm.time() ); final int md = round( myFilm.duration() ); if (mt == md) { myFilm.pause(); println("Done! Next coming up..."); if (++myMoviesIndex == maxMovies) myMoviesIndex = 0; }