mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-11 09:14:39 +02:00
Update groovy-pt.html.markdown
Update Portuguese version to the original version in English
This commit is contained in:
committed by
GitHub
parent
4bbbdf09a0
commit
94c9dea696
@@ -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)
|
||||
|
Reference in New Issue
Block a user