上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 56 下一页
摘要: interface IMyifc<T> { T ReturnValue(T v); } class MyClass : IMyifc<int>, IMyifc<string> { public int ReturnValue(int v) { return v; } public string Re 阅读全文
posted @ 2022-10-21 10:40 double64 阅读(85) 评论(0) 推荐(0)
摘要: class IA_TEST { interface ITest { void Test(); } abstract class IATest : ITest { public abstract void Test(); } class MyTest : IATest { public overrid 阅读全文
posted @ 2022-10-21 09:53 double64 阅读(48) 评论(0) 推荐(0)
摘要: C# Async 方式 简单的流程测试: 去上班 吃早餐 上班中... 摸鱼 下班 using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Ne 阅读全文
posted @ 2022-10-21 09:45 double64 阅读(109) 评论(0) 推荐(0)
摘要: CancellationTokenSource 和 CancellationToken。 包含命名空间:using System.Threading.Tasks;。 class CancellationPractice { static void Main() { CancellationToken 阅读全文
posted @ 2022-10-19 15:18 double64 阅读(172) 评论(0) 推荐(0)
摘要: 嵌套的命名空间,低级的可以直接访问高级层次的命名空间,而相反不行。 // 低级层次的也是高级层次的一部分。 平级的不能直接访问,但 using 时可以省略共同高级部分。 嵌套命名空间:没有就创建,有就合并。 高级层次的命名空间自然是不能和低层级或同级有相同的签名声明。如,下面在 A 命名空间中定义 阅读全文
posted @ 2022-10-19 13:18 double64 阅读(212) 评论(0) 推荐(1)
摘要: 这样:ref int b = ref a; int a = 100; ref int b = ref a; b = 111; Console.WriteLine($"a = {a}, b = {b}"); Console.WriteLine("a = {0}, b = {1}", a, b); 输出 阅读全文
posted @ 2022-10-19 10:30 double64 阅读(39) 评论(0) 推荐(0)
摘要: 可以用结构体包裹下,做下标识。 #include <iostream> #include <string> #include<cassert> using namespace std; struct VoidType { string Type; void* pVoid; VoidType(stri 阅读全文
posted @ 2022-10-18 20:41 double64 阅读(39) 评论(0) 推荐(0)
摘要: C++ #include <iostream> #include <map> /***********************/ // 基类 鞋子 class Shoes { public: virtual void Show() = 0; virtual ~Shoes() {} }; // 耐克鞋 阅读全文
posted @ 2022-10-16 22:11 double64 阅读(65) 评论(0) 推荐(0)
摘要: C++ #include <iostream> #include <map> /***********************/ // 基类 鞋子 class Shoes { public: virtual void Show() = 0; virtual ~Shoes() {} }; // 耐克鞋 阅读全文
posted @ 2022-10-16 21:42 double64 阅读(75) 评论(0) 推荐(0)
摘要: 不要将设计模式当成算法去学习,初期可以模仿,但更多的它是一种思想 —— 管理变化,提高复用。 两个手段:分解 vs 抽象。 八大原则 依赖倒置原则(DIP) 开放封闭原则(OCP) 单一职责原则(SRP) Liskov 替换原则(LSP) 接口隔离原则(ISP) 对象组合优于类继承 封装变化点 面向 阅读全文
posted @ 2022-09-30 16:39 double64 阅读(31) 评论(0) 推荐(0)
上一页 1 ··· 20 21 22 23 24 25 26 27 28 ··· 56 下一页