Join Slack
why does the following code snippet ```"foo" > "bar" ``` magically works in Kotlin REPL and retu...
# getting-started
d
David Hu
10/22/2022, 4:01 AM
why does the following code snippet
Copy code
"foo" > "bar"
magically works in Kotlin REPL and returns a boolean instead of throwing an error or exception? how is it even possible to "compare" strings this way when the same code in Java does not work at all?!
k
Kevin Healy
10/22/2022, 4:03 AM
Take a look at
https://kotlinlang.org/docs/operator-overloading.html
d
David Hu
10/22/2022, 4:07 AM
wow! kotlin magic 🔮
K 1
2
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by