【发布时间】:2013-03-01 01:30:34
【问题描述】:
在 VB.NET 中,我可以执行以下操作吗:
Interface X
<SomeAttrib> _
SomeProp as String
End Interface
这将强制任何实现 X 的类也将 SomeAttrib 应用于 SomeProp 并导致编译(或运行)时错误。
Class XBox
Implements X
Public SomeProp as String Implements X.SomeProp
...
End Property
End Interface
上面应该给出错误,因为SomeProp 不适用SomeAttrib。
【问题讨论】:
标签: vb.net oop interface attributes