diff options
author | Marcel Ribeiro Dantas, Ph.D <ribeirodantasdm@gmail.com> | 2022-07-07 14:52:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 14:52:40 +0200 |
commit | 94c9dea6962e973c8cdcb6da56ce4ab710ef7702 (patch) | |
tree | c377b5f6ac7c7c216753e0f39ec1b711fd018a2f | |
parent | 4bbbdf09a04c5d54590ba067fa6dc11eeefbdc2e (diff) |
Update groovy-pt.html.markdown
Update Portuguese version to the original version in English
-rw-r--r-- | pt-br/groovy-pt.html.markdown | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown index 3acfce21..3bd1ddfc 100644 --- a/pt-br/groovy-pt.html.markdown +++ b/pt-br/groovy-pt.html.markdown @@ -201,8 +201,16 @@ if(x==1) { //Groovy também suporta o operador ternário def y = 10 -def x = (y > 1) ? "functionou" : "falhou" -assert x == "functionou" +def x = (y > 1) ? "funcionou" : "falhou" +assert x == "funcionou" + +//E suporta o 'The Elvis Operator' também! +//Em vez de usar o operador ternário: + +displayName = nome.name ? nome.name : 'Anonimo' + +//Podemos escrever: +displayName = nome.name ?: 'Anonimo' //Loop 'for' //Itera sobre um intervalo (range) |