I'm trying to implement the equals method in my class..
notice: the '_data
' property is an double[][]
array im trying to compare between the two objects.
anyway it compiles and everything but i always get a false answer and this can't be because both arrays are same :o
am i doing something wrong? is there any other easy way? (only with using equals from object class!!)
My code (JAVA):
public boolean equals(Object obj) {
if (!(obj instanceof MyClass)) {
return false;
}
MyClass myObj = (MyClass) obj;
return this._data.equals(myObj._data);
}