各种数字类型转换成字符串型:
string s = string.valueof( value); // 其中 value 为任意一种数字类型。
字符串型转换成各种数字类型:
string s = "169";
byte b = byte.parsebyte( s );
short t = short.parseshort( s );
int i = integer.parseint( s );
long l = long.parselong( s );
float f = float.parsefloat( s );
double d = double.parsedouble( s );
数字类型与数字类对象之间的转换:
byte b = 169;
byte bo = new byte( b );
b = bo.bytevalue();
short t = 169;
short to = new short( t );
t = to.shortvalue();
int i = 169;
integer io = new integer( i );
i = io.intvalue();
long l = 169;
long lo = new long( l );
l = lo.longvalue();
float f = 169f;
float fo = new float( f );
f = fo.floatvalue();
double d = 169f;
double dobj = new double( d );
d = dobj.doublevalue();