Last active
June 22, 2021 00:24
-
-
Save GabrielBrasileiro/cbb5be73ca8dcfbbfb035d8712879f39 to your computer and use it in GitHub Desktop.
HighOrderFunctionInline.java
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
public static final void main() { | |
final String descricao = "Inline te dando poderes mágicos"; | |
executarOperacao(new Function() { | |
@Override | |
public void invoke() { | |
System.out.print(descricao); | |
} | |
} | |
} | |
public static final void executarOperacao(@NotNull Function operacaoDois) { | |
operacaoUm(); | |
operacaoDois.invoke(); | |
operacaoTres(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment