Topic: 初学者:java中怎样才能把整形数据转为String型?

  Print this page

1.初学者:java中怎样才能把整形数据转为String型? Copy to clipboard
Posted by: 飞鸟
Posted on: 2006-11-06 18:27


2.Re:初学者:java中怎样才能把整形数据转为String型? [Re: 飞鸟] Copy to clipboard
Posted by: lot1
Posted on: 2006-11-07 00:36

Integer.toString()
Interger.parseInt("13")

see Oreilly "Java Cookbook"

3.Re:初学者:java中怎样才能把整形数据转为String型? [Re: 飞鸟] Copy to clipboard
Posted by: 飞鸟
Posted on: 2006-11-09 23:44

浮点型转为String也一样吗?

4.Re:初学者:java中怎样才能把整形数据转为String型? [Re: 飞鸟] Copy to clipboard
Posted by: scottlai
Posted on: 2006-11-10 00:25

String.valueof.....

5.Re:初学者:java中怎样才能把整形数据转为String型? [Re: 飞鸟] Copy to clipboard
Posted by: dejinzhao
Posted on: 2006-11-10 08:21

int i=1000;
1、String s=String.valueOf(i);
2、s=""+i;
StringBuffer sb=new StringBuffer();
sb.insert(0,i);
3、s=sb.toString();
4、s=Integer.toString(i);

6.Re:初学者:java中怎样才能把整形数据转为String型? [Re: 飞鸟] Copy to clipboard
Posted by: yangjx
Posted on: 2006-11-10 08:24

String.valueOf()函数


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923