/** * Determine whether this sequence is equal to another. * * @param other the other sequence * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(Object other) { return other instanceof Sequence && equals((Sequence<?>)other); }
/** * Determine whether this sequence is equal to another. * * @param other the other sequence * @return {@code true} if they are equal, {@code false} otherwise */ public boolean equals(Object other) { return other instanceof Sequence && equals((Sequence<?>)other); }
public static void main(String args[]){ Sequence s = new Sequence(5); Sequence s2 = new Sequence(5);// new Sequence(4) s.set(0, 1); s2.set(0, 1); System.out.println(s.equals(s2));//will print true }