yyrelop.blogg.se

If not null kotlin
If not null kotlin






if not null kotlin

a = b evaluates to true if and only if a and b point to the same object. Referential equality is checked by the = operation and its negated counterpart !=. Structural equality has nothing to do with comparison defined by the Comparable interface, so only a custom equals(Any?) implementation may affect the behavior of the operator. Functions with the same name and other signatures, like equals(other: Foo), don't affect equality checks with the operators = and !=. To provide a custom equals check implementation, override the equals(other: Any?): Boolean function. Note that there's no point in optimizing your code when comparing to null explicitly: a = null will be automatically translated to a = null. If a is not null, it calls the equals(Any?) function, otherwise ( a is null) it checks that b is referentially equal to null.








If not null kotlin