源码下载

一、里氏替换原则(Liskov Substitution Principle LSP)

  我们要讲的不是协变性和逆变性(Covariance & Contravariance)吗?是的,没错。但先不要着急,在这之前,我们有必要再回味一下LSP。废话不多说,直接上代码:

 1 namespace LSP
 2 {
 3     public class Bird
 4     {
 5         public virtual void Show()
 6         {
 7             Console.WriteLine("It's me, bird.");
 8         }
 9     }
10 }
Bird

相关文章:

  • 2022-12-23
  • 2021-11-11
  • 2021-05-23
  • 2021-10-03
  • 2021-08-04
  • 2022-12-23
  • 2022-01-20
  • 2021-09-17
猜你喜欢
  • 2021-06-26
  • 2022-12-23
  • 2022-02-22
  • 2021-08-23
  • 2021-12-23
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案