关于.net:接口是什么?

What's interface for?

本问题已经有最佳答案,请猛点这里访问。

Possible Duplicates:
Interfaces: Why can't I seem to grasp them?
What is an Interface

在这个时候,我所知道的接口就是它包含类,…就像一个名称空间。它的目的是什么?我们为什么不使用名称空间呢?

谢谢您。


来自MSDN:

An interface contains only the
signatures of methods, delegates or
events. The implementation of the
methods is done in the class that
implements the interface,


请参阅此重复文章:

什么是接口

An interface is like a template design
for a class that contains no data or
implemetnation; only definitions for
methods, properties etc. These are
abstract and cannot be instantiated
but can be inherited from at which
point all specified methods etc must
be implemented by the concrete class
inheriting the interface.