To make it immutable one needs to add final keyword. That means that one can “replace” object on a given reference. In Java references of parameters of a method are mutable by default. Mutability of method parameter’s references Java In this article, we’ll go through a few of them. Having to add a bunch of nullability annotations, final keywords, override equals/hashCode methods, create additional local variables after type checks - all of this adds unnecessary work that needs to be done all the time.īut also there are some differences between Kotlin and Java, which are not that significant, though useful. There are a bunch of articles about cool Kotlin features like immutability, handling nullability, smart-cast, data classes, and so forth. Learning process was fairly simple because Kotlin has many similarities when at the same time improves development experience by fighting common pain points Java developer (especially on Java 6, which is common in Android world) has to encounter every day. Many of us first learned Kotlin after Java. Kotlin useful but unfairly not mentioned features May 3, 2020
0 Comments
Leave a Reply. |