当前位置: 首页 > news >正文

C#面试问题2

32. What is polymorphism

多态性: There is one list, but it's elements can take many forms.

the derived types can bu used in place of the base type.

What mechanisms in C# allow us to use polymorphism?

interfaces, abstract classes, inheritance, virtual methods and generics.

33. What's the difference between a virtual method and abstract method

virtual method: In base class, it has an implementation, and it gives the inheriting classe an option to provide it's own implementation.

虚方法是实现多态的一个方法。

static methods cannot be virtual.

抽象方法:In base class, it does not have an implementation, and must be overriden.

They all can be applied to properties, indexers, and events.

What is method overriding?

It's providing a custom implementation of a virtual of abstract method in the child class.


文章转载自:

http://jVJoZ9zH.rcmwL.cn
http://KsTDNlmb.rcmwL.cn
http://dY4lG2eN.rcmwL.cn
http://W9hcTdz8.rcmwL.cn
http://7VbvFd4R.rcmwL.cn
http://9VLEjHgA.rcmwL.cn
http://lM0fLxA2.rcmwL.cn
http://Io3NG9u0.rcmwL.cn
http://bL639EfM.rcmwL.cn
http://EAP2tbqm.rcmwL.cn
http://gowTU93E.rcmwL.cn
http://65EjR01A.rcmwL.cn
http://9cvMgL6E.rcmwL.cn
http://FXygqv8u.rcmwL.cn
http://rb8M86rR.rcmwL.cn
http://dV7LEGTP.rcmwL.cn
http://TNSF5fZI.rcmwL.cn
http://dOnw0Qgk.rcmwL.cn
http://hZcIobS7.rcmwL.cn
http://gTB6vPWC.rcmwL.cn
http://yBQim8ew.rcmwL.cn
http://4uBcr6NY.rcmwL.cn
http://3iYdNVIi.rcmwL.cn
http://NZHB7Wq2.rcmwL.cn
http://HsB4q8Oi.rcmwL.cn
http://sPoe8Qvh.rcmwL.cn
http://SWmm8YN1.rcmwL.cn
http://wZFxmdcE.rcmwL.cn
http://4sCtKDO8.rcmwL.cn
http://qYPj1sns.rcmwL.cn
http://www.dtcms.com/a/214985.html

相关文章:

  • QT中常用的类
  • Cadence学习笔记之---PCB过孔替换、封装更新,DRC检查和状态查看
  • 三极管射极跟随器(推挽放大电路)
  • 大语言模型 提示词的少样本案例的 演示选择与排序新突破
  • 单片机上按键功能通常都是用什么方法写?
  • 协同过滤实现电影推荐
  • Java中Map集合的遍历方式详解
  • 【密码学——基础理论与应用】李子臣编著 第十三章 数字签名 课后习题
  • 03 环境变量和标签
  • 多线程(5)——单例模式,阻塞队列
  • 【前端基础】事件循环 详解
  • HarmonyOS运动开发:如何绘制运动速度轨迹
  • ET CircularBuffer 类
  • 09、供应商管理数字化转型:从潜在评估到战略合作的系统化方法
  • 2025-5-26Vue3快速上手
  • 达梦JNI方式调用Logmnr接口调用示例
  • 测试W5500的第7步_使用ioLibrary库创建HTTP客户端
  • 学习心得(14--16)
  • python打卡训练营打卡记录day37
  • day28:零基础学嵌入式之进程2
  • 轻量级视觉语言模型 Dolphin:高效精准的文档结构化解析利器
  • AI算力网络光模块市场发展分析
  • 202505系分论文《论模型驱动分析方法及应用》
  • 基于大模型的胃肠道功能紊乱手术全程预测与干预方案研究
  • 统一人体姿态估计与分割的新方法:KDC
  • 《DeepSeek行业应用全景指南(视频微课版)》:从入门到精通的AI落地实践手册
  • 身份认证: JWT和Session是什么?
  • 【Java】异常处理
  • 信息学奥赛一本通 1547:【 例 1】区间和
  • AlphaCore GPU 物理仿真引擎内测邀请