Last active
December 29, 2018 20:05
-
-
Save yp-palF/694d9d88f790927fb44f66d94996ab8b to your computer and use it in GitHub Desktop.
LAMBDA BLOG: Main file with lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BookMyMovie { | |
public static void main (String[] args) throws Exception { | |
// List<Movie> movies = List of movies | |
Filter horrorMovieFilter = (movie) -> movie.getGenre().equals(MovieType.HORROR); | |
for (Movie movie : movies) { | |
System.out.println("Movie: " + movie.getName() + " is Horror? " + horrorMovieFilter.isApplicable(movie)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment