kotlin
val numbers = listOf(1, 2, 3, 4, 5)
val sum = numbers.stream()
.filter { it > 2 }
.map { it * 2 }
.sum()
kotlin
import java.util.concurrent.Callable
fun execute(action: () -> Unit) {
action.invoke()
}
val callable = Callable { println("Hello, Kotlin Stdlib Jdk8!") }
kotlin
import java.time.LocalDate
val currentDate = LocalDate.now()
val nextWeek = currentDate.plusWeeks(1)
gradle
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}