
要优雅
Ca_va
我曾远去,我亦归来
展开
-
C#架构 静态方法调用非静态字段
通过构建构造函数方式进行 List item public class Test { private readonly string _propA; public string PropA => _propA; public Test(string propA) { this._propA = propA; } public static Test Set原创 2020-11-27 23:24:05 · 948 阅读 · 0 评论 -
C#优雅 :this之构造函数的使用
通俗来说,可以说是构造函数的继承 (1) :this()用来继承无参时的构造函数,例如下面代码 static void Main(string[] args) { AA aA = new AA("c","d"); Console.WriteLine(aA.aa); Console.WriteLine(aA.bb); Console.WriteLine(aA.cc);转载 2020-08-13 23:17:25 · 613 阅读 · 0 评论