Hi , may i know why i keep on getting this error? i tried to inherit an interface. I already implement all the member in that base interface but still i get this error.

Error 1 does not implement interface member cannot implement an interface member because it is not public.


Is there anybody know how to make a class to inherit these code?

Thanks a lot.

Edited by wen30: n/a

8 Years
Discussion Span
Last Post by ClavetA

To implement an interface member, the corresponding member on the class must be public, non-static, and have the same name and signature as the interface member.

Verify if your member declaration explicitly declare the method as public. If it is not specified, it will be treated as private.

Auto-generated interface members are private by default.

Default interface implementation :

int IComparer.Compare( Object x, Object y ) {

Correct implementation of the interface :

public int  IComparer.Compare( Object x, Object y ){

Edited by ClavetA: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.