Last active
July 4, 2021 14:07
-
-
Save nunomazer/3dc2b1664005caf07061a0b8b47ef82e to your computer and use it in GitHub Desktop.
Exemplo de uso de classes Java em Kotlin
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
fun main(args: Array<String>) { | |
val lista = arrayListOf(1, 2, 3) | |
println("O objeto lista, " + | |
"com valores: $lista, é um objeto " + | |
"Java do tipo: " + lista.javaClass) // >> class java.util.ArrayList | |
} |
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
import java.time.LocalDate | |
fun main(args: Array<String>) { | |
val hoje = LocalDate.now() | |
val semana = hoje.plusDays(7); | |
println("A data de hoje é: $hoje, em uma semana será: $semana") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment