public interface IMyInterface
{
List<string> MyList(string s)
}
public class MyClass : IMyInterface
{
public List<string> MyList(string s)
}
有什么区别:
[Method]
MyClass inst = new MyClass();
...
或者:
[Method]
var inst = new MyClass() as IMyInterface;
...
或者:
[Method]
IMyInterface inst = new MyClass();
...
使用 IMyInterface 实现的正确方法是什么?