C#类型转化

 

类型转化主要包括两种类型:显示转化和隐式转化

顾名思义,显示转化要有转化的标志

例子

int i=1;

 string str=i.ToString();

隐式转化是不用标志,是在内部处理的

例子

byte bt;

short sht=7;

bt=sht;

console.write("{0},{1}",sht,bt);

结果都是7;

原文地址:https://www.cnblogs.com/lzhp/p/2680806.html