随笔分类 - C# Keywords
摘要:decimal d2 = 0.0000002500m; Console.WriteLine(d2.ToString()); double d3 = 0.0000002500; Console.WriteLine(d3.ToString()); 输出结果是, 0.00000025002.5E-07 d
阅读全文
摘要:https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/is 原来的版本 优化后的版本 涉及到的新知识点 Type pattern When using the type pattern to perfor
阅读全文
摘要:https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_JsonConvert.htm 在使用DeserializeObject函数进行转换的时候,会自动处理,如果和T匹配,就会转换好。 如果类型不匹配,也不会报错的。 json字符的转
阅读全文
摘要:Why use the 'ref' keyword when passing an object? Pass a ref if you want to change what the object is: TestRef t = new TestRef(); t.Something = "Foo";
阅读全文
摘要:https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out You can use the out contextual keyword in two contexts: As a parameter
阅读全文
摘要:http://stackoverflow.com/questions/22940317/protected-vs-protected-internal-again-in-c-sharp protected means that you can access the member from any s
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/bcd5672a.aspx The protected keyword is a member access modifier. A protected member is accessible within its
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/sf985hc5.aspx The abstract modifier indicates that the thing being modified has a missing or incomplete imple
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/435f1dw2.aspx When used as a declaration modifier, the new keyword explicitly hides a member that is inherite
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/51y09td4.aspx In C#, the new keyword can be used as an operator, a modifier, or a constraint. Used to create
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/ebca9ah3.aspx The override modifier is required to extend or modify the abstract or virtual implementation of
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/9fkccyh4.aspx The virtual keyword is used to modify a method, property, indexer, or event declaration and all
阅读全文
摘要:const 与 readonly知多少 Practical Difference between Const & ReadOnly What is the difference between const and readonly? Apart from the apparent differenc
阅读全文
摘要:https://msdn.microsoft.com/en-us/library/bcd5672a.aspx 官方的说法The protected keyword is a member access modifier. A protected member is accessible within
阅读全文
摘要:正常情况下,父类virtual的方法,子类override 另外一种情况,父类的方法不是virtual的,但是子类中有同名的方法 但是子类需要隐藏掉父类的方法
阅读全文