当前位置: 首页 > 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.

相关文章:

  • 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
  • 烟台市最好的专业做网站的公司/win10最强性能优化设置
  • wordpress自定义密码/搜狗seo查询
  • 高大上公司网站/百度官方客户端
  • php 网站版面素材/seo算法培训
  • 有网站怎么做seo推广/百度入口网站
  • 南山做棋牌网站建设/seo基础知识培训