Hacker News new | past | comments | ask | show | jobs | submit login

Does Kotlin have its own class/libraries or it still uses Java's classes?



Kotlin has its own standard library


It's both.

Kotlin's standard library is tiny. It consists mostly of extension functions and aliases over the Java standard library. For instance kotlin.String is just an alias to java.lang.String, it's exactly the same object. Kotlin's lists are just more type safe views over java.util lists. Much of Kotlin's standard library is in fact inlined and then optimised, so using it doesn't even create function calls in your bytecode.

So whilst Kotlin does technically have a standard library, to do anything practical you'll be using Java's. And that's one reason why we like it. No duplicate standard library to learn.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: