[导入]C#中显/隐式实现接口及其访问方法
摘要: 1.隐式实现的接口
interface IControl
{
void Paint();
}
public class EditBox : IControl
{
public void Paint()
{
Console.WriteLine("Pain method is called!");
}
}
class Test
{
static void Main()
{
EditBox editbox = new EditBox();
editbox.Paint();
((IControl)editbox).Paint();
Console.ReadKey();
}
}
结果:
Pain method is called!
Pain method 阅读全文![](https://dnawo.cnblogs.com/aggbug/1016243.html)
文章来源:http://www.cnblogs.com/dnawo/archive/2007/12/27/1016243.html
interface IControl
{
void Paint();
}
public class EditBox : IControl
{
public void Paint()
{
Console.WriteLine("Pain method is called!");
}
}
class Test
{
static void Main()
{
EditBox editbox = new EditBox();
editbox.Paint();
((IControl)editbox).Paint();
Console.ReadKey();
}
}
结果:
Pain method is called!
Pain method 阅读全文
文章来源:http://www.cnblogs.com/dnawo/archive/2007/12/27/1016243.html
成功者找方法,失败者找借口!