C#中的接口是什么?请告诉我一个实时示例? [英] What is interface in C#? Please tell me a real time example?

查看:60
本文介绍了C#中的接口是什么?请告诉我一个实时示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#中的接口是什么?
请告诉我一个实时示例?

What is interface in C#?
Please tell me a real time example?

推荐答案

saurabhajay写道:
saurabhajay wrote:

什么是c#中的界面?请告诉我一个实时示例?

what is interface in c#?pls tell me a real time example?





interface IClock
{
  DateTime now();
}


:-D


认真地,请参阅文档[ ^ ].
:)


:-D


Seriously, see the documentation [^].
:)


另一个作业问题? Google是您的朋友:使用它.
Another homework question? Google is your friend: use it.


在现实世界中,Interface就像手机或通用遥控器一样.您的所有电视机都有一个遥控器(接口):笑:(子类)
因此,使用一个接口可以使用许多子类. :omg:
In real world example, Interface is just like a mobile phone or universal remote control. You have one remote control(interface) for all your TV sets :laugh:(sub classes)
So using one interface you use many sub-classes. :omg:


这篇关于C#中的接口是什么?请告诉我一个实时示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆