Although the accepted answer is correct in your particular scenario, this is not always the case.
Redeclaring the interface in the class declaration can be useful and necessary: when you want to reimplement the interface.
Consider the following code, study it carefully:
interface IFoo {
string Foo(); }
class A: IFoo {
public string Foo() { return "A"; } }
class B: A, IFoo {
}
class C: A {
new string Foo() { return "C"; } }
class D: A, IFoo {
string IFoo.Foo() { return "D"; } }
And now try to figure out what the following code will output:
IFoo a = new A();
IFoo b = new B();
IFoo c = new C();
IFoo d = new D();
Console.WriteLine(a.Foo());
Console.WriteLine(b.Foo());
Console.WriteLine(c.Foo());
Console.WriteLine(d.Foo());
Do you now see how redeclaring the interface (type D
) can be useful?
Also, another good point to make is how the information in MSDN can be misleading seemingly implying that many interfaces are redeclared without any apparent reason in a lot of classes; many collection types for instance redeclare infinite amount of interfaces.
This is really not true, the problem is that the documentation is built upon the assembly's metadata and the tool can't really discern if the interface is declared directly in the type or not. Also, because its documentation, explicitly telling you the implemented interfaces, regardless of where they are actually declared, is a bonus even if its not 100% accurate with the source code.