How to: Explicitly Implement Interface Members (C# Programming Guide)
来源:互联网 发布:安卓看美漫的软件 编辑:程序博客网 时间:2024/06/06 01:44
本示例声明一个 接口IDimensions 和一个类 Box,该类显式实现接口成员 getLength 和 getWidth。通过接口实例 dimensions 访问这些成员。示例:
可靠编程
请注意 Main 方法中下列代码行被注释掉,因为它们将产生编译错误。显式实现的接口成员不能从类实例访问//System.Console.WriteLine("Length: {0}", box1.getlength());
//System.Console.WriteLine("Width: {0}", box1.getwidth());还请注意,Main 方法中的下列代码行成功输出框的尺寸,因为这些方法是从接口实例调用的:System.Console.WriteLine("Length: {0}", dimensions.getLength());
System.Console.WriteLine("Width: {0}", dimensions.getWidth());
- How to: Explicitly Implement Interface Members (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Implement Interface Events
- Interface Properties (C# Programming Guide)
- How to: Use a Thread Pool (C# Programming Guide)
- 显式实现接口(Implement Interface explicitly)
- 显式实现接口(Implement Interface explicitly)
- How to implement fiber
- how to implement QAbstractScrollArea
- How to call Visual Basic .NET run-time library members from Visual C#
- Casting (C# Programming Guide)
- When to Use Delegates Instead of Interfaces (C# Programming Guide)
- How to implement globalization in C# - 1. using PropertyGrid
- How to use Interface
- php ajax仿dedecms 验证新闻是否存在
- php jquery 验证码代码
- PKU 1182
- php 过滤html标签的函数代码
- Android 实例-个人理财工具
- How to: Explicitly Implement Interface Members (C# Programming Guide)
- System.Object
- 1048 Inverso
- sap 算法
- Android 使用Mobclix实现广告盈利(http://www.javaeye.com/topic/609639)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)
- 终于弄好了ubuntu下的latex中文编辑
- How to: Explicitly Implement Interface Members with Inheritance (C# Programming Guide)