为什么C#不允许静态方法实现接口?
// These items will be displayed in a list on the screen.public interface IListItem {
string ScreenName();
...}public class Animal: IListItem {
// All animals will be called "Animal".
public static string ScreenName() {
return "Animal";
}....}public class Person: IListItem {
private string name;
// All persons will be called by their individual names.
public string ScreenName() {
return name;
}
....
}
慕田峪7331174
随时随地看视频慕课网APP