QPing's Blog
  • Home
  • Archives
  • Categories
  • Tags
  • About

C# 协变与逆变

第一次接触 C# 的协变和逆变的时候,会有些懵,为什么 in 是逆变呢。“逆”到底和什么方向相反呢?其实他们解决的问题很简单:解决类型的安全转换. 函数的转换为了演示,假定现在有两个类, Car 和 Vehicle, 其中 Car 继承 Vehicle. 123456789101112131415161718192021public class Vehicle{ protected
2025-09-08
#C#

Create Blog with Hexo

Hexo 安装根据首页教程 可以快速搭建一个本地博客. 12345npm install hexo-cli -g # 全局安装hexo-cli,这样就可以在控制台中使用hexo命令,比如 Hexo inithexo init blog # 初始化,等同于git clone + npm intallcd blog npm installhexo se
2025-09-06

Search

Hexo Fluid