sorted¶
If elements in a List implements the Comparable interface,
you can call the method sorted
to return a sorted List (in nature order).
Note: Pair in Kotin does not implement the Comparable interface!!!
Returns and Jumps in Kotlin
Break at label is a convenient way to jump out of a nested loop.
Kotlin Unit Testing
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Use Java reflection to help test private methods.
https://phauer.com/2018/best-practices-unit-testing-kotlin/
https://medium.com/mindorks/how-to-unit-test-private-methods-in-java-and-kotlin-d3cae49dccd
Use Kotlin as a Scripting Language
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Run kotlinc
to enter REPL of kotlin.
kscript Scripting enhancements for Kotlin
String functions in Kotlin
Differences Between Kotlin and Java
Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
Comparison of Kotlin to Java Programming Language
Kotlin vs Java: Most Important Differences That You Must Know