描述显式接口实现的准则。
Describes guidelines for explicit interface implementations.
下列设计准则有助于确保您的库设计仅在需要时使用显式接口实现。
The following design guidelines help ensure that your library design USES explicit interface implementation only when appropriate.
显式接口实现还允许程序员实现具有相同成员名称的两个接口,并为每个接口成员各提供一个实现。
Explicit interface implementation also allows the programmer to implement two interfaces that have the same member names and give each interface member a separate implementation.
不幸的是,此假设与实际不符,因为在元数据级别上位于每个接口上的每个方法都有各自的槽(slot)(这使得显式接口实现得以工作)。
Unfortunately, it is incompatible because at the metadata level every method on every interface has its own slot (which makes explicit interface implementations work).
在开发时执行时,此过程与上面列出的第一个选项非常相似,我们在此选择中显式地选择Add类的Math接口实现。
When performed at development time, this process is very similar to the first option listed above in which we explicitly selected the Add class' implementation of the Math interface.
在开发时执行时,此过程与上面列出的第一个选项非常相似,我们在此选择中显式地选择Add类的Math接口实现。
When performed at development time, this process is very similar to the first option listed above in which we explicitly selected the Add class' implementation of the Math interface.
应用推荐