data class Person(val name: String,
val age: Int? = null)
fun main(args: Array<String>) {
val persons = listOf(Person("영희"), Person("철수", age = 29))
val oldest = persons.maxBy{ it.age ?: 0}
println("나이가 가장 많은 사람? : $oldest")
}
-
Notifications
You must be signed in to change notification settings - Fork 0
bkkanq/kotlin-in-action
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
practice
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published