Kotlinlearncs.online LogoJava
Return to List

Solve: SimpleArrayList equals

Created By: Geoffrey Challen
/ Version: 2021.4.0

Given the starter code for the SimpleArrayList class below, complete the equals method. equals should return true if the passed Any? is a SimpleArrayList with the same length and with the same items in the same positions.

Note that you do not and should not complete the other list methods: get, set, add, or remove.

class SimpleArrayList(private val values: Array<Any>) {
override fun equals(other: Any?): Boolean = false
}

Related Lessons

Stuck? You may find these lessons helpful: