Skip to content

Instantly share code, notes, and snippets.

@rssh
Created September 15, 2014 21:17
Show Gist options
  • Save rssh/8a4375719ca1622a0580 to your computer and use it in GitHub Desktop.
Save rssh/8a4375719ca1622a0580 to your computer and use it in GitHub Desktop.
jdv_article5 (simple lambda expression in scala)
list.sort((x,y) => {
val cmp = x.lastName.compareTo(y.lastName)
if (cmp!=0) cmp else x.firstName.compareTo(y.lastName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment