【发布时间】:2016-12-16 16:52:41
【问题描述】:
我有以下两个已经继承到XYZ的类
国家类
公共课 country_master : XYZ { 私有字符串_id; 公共字符串标识 { 得到{返回_id; } 设置 { _id = 值; } } 私人字符串_country_code; 公共字符串 country_code { 得到 { 返回 _country_code; } 设置 { _country_code = 值; } } 私人字符串 _country_name; 公共字符串国家名称 { 得到 { 返回 _country_name; } 设置 { _country_name = 值; } } }状态类
公共类 state_master: XYZ { 私有字符串_id; 公共字符串标识 { 得到{返回_id; } 设置 { _id = 值; } } 私有字符串_state_code; 公共字符串 state_code { 得到 { 返回 _state_code; } 设置 { _state_code= 值; } } 私有字符串_state_name; 公共字符串 state_name { 得到 { 返回 _state_name; } 设置 { _state_name= 值; } } }- 现在,我想在我的
state_master类中使用country_name,这怎么可能?
谢谢。
【问题讨论】:
-
你想怎么用?在一个方法?
state_master的每个实例都有一个唯一实例? -
在 state_master 方法中。
-
兄弟,
state_master类只能使用XYE属性,如果你想使用country_name,你可以在state_master类中使用country_master作为属性,或者也许将country_name移动到XYZ类。 -
XYZ 被使用,因为使用了另一个属性。
-
任何其他类似界面的方式???
标签: c#