Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override bool Equals(object obj)
- {
- bool iguals = true;
- int posicio = 0;
- if (obj == null)
- {
- return this == null;
- }
- if (!(obj is TipusBase))
- {
- return false;
- }
- Pila<TipusBase> comparada = (Pila<TipusBase>)obj;
- return base.Equals(obj);
- if (this.nElem != comparada.nElem)
- {
- iguals = false;
- }
- else
- {
- while (iguals && posicio < nElem)
- {
- iguals = object.Equals(dades[posicio], comparada.dades[posicio]);
- posicio++;
- }
- }
- return iguals;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement