Kotlin learns to write notes. You don't even understand the principle

class Person(val age: Int, val name: String){ override fun equals(other: Any?): Boolean { val other = (other as? Person)?: return false return other.age == age && other.name == name } override fun hashCode(): Int { return 1 + 7 * age + 13 * name.hashCode() } } And java Similarly, if it is added to a data struc ...

Added by buildakicker on Tue, 07 Sep 2021 03:57:53 +0300

_ Kotlin_ Series_ 2, Kotlin generic, byte Android Senior Engineer Interview

2. What is the use of generics? 3. How to define and use generics? 1. What is generics? The popular understanding of generics is that many types allow us to program without specifying specific types by using the concept of parameterized types 2. What is the use of generics? Generics is a security mechanism introduced by JDK 1.5 and a techn ...

Added by magic2goodil on Fri, 03 Sep 2021 09:17:54 +0300

Kotlin: high order function, small code farmers also have big dreams

1.1. Higher order function when function is used as function parameter Here we introduce sumBy{} higher-order functions in strings. Take a look at the source code first //  Source code of sumBy function public inline fun CharSequence.sumBy(selector: (Char) -> Int): Int {     var sum: Int = 0     for (element in this) {         ...

Added by shneoh on Fri, 03 Sep 2021 01:44:50 +0300