Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2017 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ba398be974f1861256a5770eb33b009c to your computer and use it in GitHub Desktop.
Save anonymous/ba398be974f1861256a5770eb33b009c to your computer and use it in GitHub Desktop.
object KFoo {
private data class Person internal constructor(val age: Int, val name: String)
@JvmStatic fun main(args: Array<String>) {
val people = mutableListOf(
Person(20, "A"),
Person(18, "B"),
Person(22, "C")
)
people.sortBy { it.age }
println(people)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment