Skip to content

Instantly share code, notes, and snippets.

@mahata
Created January 3, 2018 09:40
Show Gist options
  • Save mahata/1c1347321d501f22e86cc6f6978cadf2 to your computer and use it in GitHub Desktop.
Save mahata/1c1347321d501f22e86cc6f6978cadf2 to your computer and use it in GitHub Desktop.
val arrayList = arrayListOf(1, 5, 2)
Collections.sort(arrayList, object : Comparator<Int> {
override fun compare(o1: Int, o2: Int) = o2 - o1
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment