Created
April 3, 2020 10:15
-
-
Save Raouf25/bf937f9cfc9dc45e5e14fea1fd15d92b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Use the City's method references and assign them to functions | |
Function<City, String> getNameFunction = City::getName; | |
Function<City, String> getCodeFunction = City::getCode; | |
System.out.println("The code for " | |
+ getNameFunction.apply(sf) | |
+ " is " | |
+ getCodeFunction.apply(sf)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment