C#3

定义常量:1.静态常量 const(定义时必须初始化)  、、、常量都不可以改变

              2.动态常量 readonly(定义时不必初始化) \要在Main方法前面

用法:const double PI = 3.14       readonly double PI = 3.14

类型转换:隐式类型转换:低精度会自动转换为高精度 如int转为double

             显示类型转换:double a=10; int c = (int)a;

                                 或 int c = Convert.ToInt32(a);

                                或 int c = Int.Parse(a.ToString());  因为Parse 用于字符转为其他类型

原文地址:https://www.cnblogs.com/wshyj/p/6048044.html