Читать книгу Programming Kotlin Applications - Бретт Мак-Лахлин, Brett McLaughlin - Страница 18

What Does Kotlin Add to Java?

Оглавление

That's a good question that has a long answer. In fact, we'll spend most of this book answering that in various forms. But, for most, Kotlin adds or changes a few key features when compared to Java:

NOTE If you're new to Kotlin or not coming from a Java background, feel free to skip right on to the next section.

 Kotlin ditches NullPointerException (and nullable variables altogether) in almost all situations.

 Kotlin supports extending functions without having to entirely override a parent class.

 Kotlin doesn't support checked exceptions (you may not find this to be an advancement, so fair warning).

 Kotlin adds components of functional programming, such as extensive lambda support and lazy evaluation.

 Kotlin defines data classes that let you skip writing basic getters and setters.

There's certainly a lot more to this list, but you can quickly see that Kotlin isn't just a slightly different version of Java. It seeks to be different and better, and in many ways, it very much is exactly that.

Programming Kotlin Applications

Подняться наверх