Last active
March 12, 2019 04:50
Star
You must be signed in to star a gist
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
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