Skip to content

Instantly share code, notes, and snippets.

@nunomazer
Last active July 4, 2021 14:07
Show Gist options
  • Save nunomazer/3dc2b1664005caf07061a0b8b47ef82e to your computer and use it in GitHub Desktop.
Save nunomazer/3dc2b1664005caf07061a0b8b47ef82e to your computer and use it in GitHub Desktop.
Exemplo de uso de classes Java em Kotlin
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
}
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