Equals method for data class in Kotlin

In Kotlin data classes equality check, arrays, just like other classes, are compared using equals(…), which compares the arrays references, not the content. This behavior is described here: So, whenever you say arr1 == arr2 DataClass(arr1) == DataClass(arr2) … you get the arrays compared through equals(), i.e. referentially. Given that, val arr1 = intArrayOf(1, 2, … Read more

How default .equals and .hashCode will work for my classes?

Yes, the default implementation is Object’s (generally speaking; if you inherit from a class that redefined equals and/or hashCode, then you’ll use that implementation instead). From the documentation: equals The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)