Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
data class Funcionario(
val nome: String,
val salario: Int, // Aqui vamos apenas supor que ele ganhe valores sem quebra para facilitar
val numeroFilhos: Int = 0
)
fun main(args: Array<String>) {
val funcionarios = listOf(Funcionario("William", 999, 2))
funcionarios.filter { it.salario < 1000 }
.map { it.nome to it.salario + it.numeroFilhos * 100 }
.forEach { println("${it.first} irá receber ${it.second}") }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.