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 Object 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.

public class SimpleArrayList {
private final Object[] values;
public SimpleArrayList(Object[] setValues) {
assert setValues != null;
values = setValues;
}
public boolean equals(Object o) {
return false;
}
}

Related Lessons

Stuck? You may find these lessons helpful: