Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vicboma1 committed Apr 13, 2016
1 parent cc8801d commit 4753f8e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,10 +365,20 @@ import java.util.*

fun getList(): List<Int> {
val arrayList = arrayListOf(1, 5, 2)
Collections.sort(arrayList, object : Comparator<Int> {
override fun compare(x: Int, y: Int) = y - x
})
Collections.sort(arrayList, { x, y -> y - x })
[
Collections.sort(arrayList, object : Comparator<Int> {
override fun compare(x: Int, y: Int) = y - x
})

OR
Collections.sort(arrayList, { x, y -> y - x })

OR
Collections.sort(arrayList, {x:Int, y:Int -> y - x})
]
return arrayList
}

return arrayList
}
```
Expand Down

0 comments on commit 4753f8e

Please sign in to comment.