Created
November 8, 2019 13:33
-
-
Save cmonkey/c249817d94d685d447d47e1a9f7d4845 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
import java.util.function.Consumer; | |
import java.util.function.Function; | |
import java.util.function.Supplier; | |
public class BeerProcessorChallenger{ | |
private static int drunkenness; | |
public static void main (String [] args) { | |
Supplier<Integer> moneBeerSupplier = () -> drunkenness = 5; | |
drunkenness = 10; | |
Function<Integer, Integer> processBeer = beerProccessor -> drunkenness = (beerProccessor + drunkenness); | |
Consumer<Integer> homerBeerConsumer = System.out::println; | |
homerBeerConsumer.accept(moneBeerSupplier.get() + processBeer.apply(drunkenness)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment