
上QQ阅读APP看书,第一时间看更新
Concise code
Kotlin code is elegant and clear and has a lot less boilerplate code than Java. When we compare a Java class and a Kotlin class that perform the same task, the one written in Kotlin will typically be much more concise, clear, and compact than the one written in Java. Kotlin greatly reduces the boilerplate code, meaning we don't need to write getters, setters, or toString(), hashCode(), or equals() functions. Kotlin generates all these constructs by itself, making the language more clean and concise.
We can choose which language to use for application development. If we already have an application written in Java, we can include Kotlin to get the benefits that it offers so that the code becomes clear, concise, and easy to maintain.