Re: ArrayList Contains

Tech-Archive recommends: Fix windows errors by optimizing your registry




"HarvSather" <harvsather@xxxxxxx> wrote in message
news:%23xDoA9mcGHA.1264@xxxxxxxxxxxxxxxxxxxxxxx
Well, I found the answer

I was declaring the Equals method with the wrong signature

Initially I had
public bool Equals(clsValueListItems vobjItem)

but it should be
public override bool Equals(object vobjItem)


Always use intellisense - it saves a lot of problems - You can start the
line with "override" rather than public and it will sort it all out nicely
for you when you've decided what you are overriding.

Of course if you had put override in anyway the compiler would have told you
that you weren't overriding anything.


.



Relevant Pages

  • Re: The Override Problem
    ... >> occasionally override. ... >> get the method signature off by a hair. ... > JBuilder provides an "override method" wizard which can insert stubs ... > for all inherited abstract methods and can insert stubs for selected ...
    (comp.lang.java.programmer)
  • Re: feature question
    ... a base method BM with signature "C M;" ... an override OM with signature "D M;" ... DerivedFactory GetFactoryin the DerivedObject class ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: method overriding
    ... Parent Parent.method ... Nothing like that is possible for Java, in fact, I haven't ... would override Parent.method if all slots in the child method's signature ...
    (comp.lang.java.programmer)
  • Re: override by name in c#?
    ... > public int Add ... That's not an override - it doesn't have the override modifier. ... That seems odd if you've changed the signature - it shouldn't. ... > because it's not the same signature, it does, and apart from the warning, this ...
    (microsoft.public.dotnet.languages.csharp)
  • override by name in c#?
    ... public int Add ... This seems to work, but it generates a warning 'the new specifier is needed, ... But even though I didn't think this would work to override the base class ... because it's not the same signature, it does, and apart from the warning, this ...
    (microsoft.public.dotnet.languages.csharp)