Created
April 20, 2017 13:10
-
-
Save handersonbf/c14adfbc22a2e3498bb39a5f7126ec0c to your computer and use it in GitHub Desktop.
Classe de exemplo de uso de uma Interface Funcional
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
public class ExecutandoInterfaceFuncional { | |
public static void main(String[] args) { | |
String cpf = "09551130401"; | |
Validador validar = new Validador() { | |
@Override | |
public boolean validarCPF(String valor) { | |
return valor.matches("(?!(\\d)\\1{10})\\d{11}"); | |
} | |
}; | |
Validador validarLambda = (v) -> v.matches("(?!(\\d)\\1{10})\\d{11}") ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment