第五节、实现接口
1、显式实现接口成员
为了实现接口,类可以定义显式接口成员执行体(explicit interface member implementations)。显式接口成员执行体可以是一个方法、一个属性、一个事件或者是一个索引指示器的定义,定义与该成员对应的全权名应保持一致。
| using system ; interface icloneable { object clone( ) ; } interface icomparable { int compareto(object other) ; } class listentry: icloneable, icomparable { object icloneable.clone( ) {…} int icomparable.compareto(object other) {…} } |
| class shape: icloneable { object icloneable.clone( ) {…} int icomparable.compareto(object other) {…} } |
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器