Skupaj Skupaj - 4 months ago 32
C# Question

Making interface from class

I'm having some troubles making an interface for my class. I tried with a simple public void and that worked. But i cannot get it to work with the public static voids in the code below. I think it has something to do with the enum as a parameter in the method. But How do i fix this?

This is the class:

enter image description here

And this is my interface:

enter image description here


Interfaces are contracts. They specify the method signatures for all methods within the contract.

In your interface, you have:

void FFT(/*stuff*/)

Yet, in your implementation, you have defined

static void FFT(/*stuff*/)

Now, why can't we use static? From Joel Spoelsky

Because an interface is a "contract" or an agreement between the consumer (caller) and the provider (callee). An interface describes what and how the calle will provide functionality. There is no need for static members provided by a third party. Static members cannot be overridden by a provider so they do not belong in an interface.