I am writing a BigInteger Class to work with Big Numbers. My BigInteger class has a String variable number to save the absolute value of the number and an integer variable sign to save the sign of this number.
Here is my function to compare 2 numbers:
public boolean equals(Object other) { if (other instanceof BigInteger) return toString().equals(other.toString()) && sign == other.sign; return false; } However, when I compile, I get this error:
java: cannot find symbol symbol: variable sign location: variable other of type java.lang.Object
Can anyone fix this error? Thank you