3
继承如何作用于属性?
Inherited属性的bool属性指的是什么? 这是否意味着如果我使用属性定义了我的类AbcAtribute(具有Inherited = true),并且从该类继承了另一个类,则派生类也将具有相同的属性? 为了用一个代码示例来阐明这个问题,请想象以下内容: [AttributeUsage(AttributeTargets.Class, Inherited = true)] public class Random: Attribute { /* attribute logic here */ } [Random] class Mother { } class Child : Mother { } 是否Child也Random应用了属性?
108
c#
.net
vb.net
attributes