Advertisement
eallik

Untitled

Jan 11th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.19 KB | None | 0 0
  1.   case class Person(name: String, age: Int)
  2.   val people = List(Person("John", 29), Person("Doe", 39))
  3.   val peopleByAge = people.sortBy(_.age)
  4.   val peopleByName = people.sortBy(_.name)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement