I am a Java developer who is trying to move to C #, and I am trying to find a good equivalent to some Java code. In Java, I can do this:
public interface MyInterface
{
public void theMethod();
}
public abstract class MyAbstractClass implements MyInterface
{
}
public class MyClass extends MyAbstractClass
{
public void theMethod()
{
}
}
What is the C # equivalent? The best solutions using abstract / new / override, etc., It seems to lead to the fact that "theMethod" is declared the body of one form or another of the abstract class. How can I eliminate the reference to this method in an abstract class, where it does not belong, and ensure its implementation in a specific class?
source
share