首页天道酬勤string型转化为int型,int强转string类型

string型转化为int型,int强转string类型

张世龙 05-06 00:20 82次浏览

Int-----String,四种方法

publicclassintegerdemo2{ publicstaticvoidmain [ ] args } { intnum=100; //1String s1='' num; system.out.println(S1; //2stringS2=string.valueof(num ); system.out.println(S2; //3integerI=newinteger(num ); String s3=i.toString (; system.out.println(S3; //4stringS4=integer.tostring(I; system.out.println(S4; }} String----Int2种

字符串s=' 100 '; integerii=newinteger(s; int x=ii.intValue (; 系统. out.println (x; inty=integer.parseint(s; system.out.println(y; 结果http://www.Sina.com/http://www.Sina.com /

java大学实用教程第四版答案,python程序设计题库