好吧,假设我有2个接口IBook,IJournal
除了一个不同的枚举之外,每个都具有相同的属性,例如:
public interface IBook
{
//each Book Must have these parameters.
BookCategory BookType { get; set; }
string ItemName { get; set; }
DateTime Time { get; set; }
int Copynumber { get; set; }
}
public interface IJournal
{
JournalCategory JournalType { get; set; }
string ItemName { get; set; }
DateTime Time { get; set; }
int Copynumber { get; set; }
}
,名为AbstractItem的类使用它们:class AbstractItem:Ibook,IJournal
会发生什么?
我会有:
BookCategory BookType { get; set; }
JournalCategory JournalType { get; set; }
string ItemName { get; set; }
DateTime Time { get; set; }
int Copynumber { get; set; }
?
答案 0 :(得分:0)
是的,这正是你将拥有的。你没试过吗?