作者TonyQ (骨头)
看板java
标题Re: [问题] 关於 output format
时间Tue Mar 20 23:37:01 2007
※ 引述《darkmiz (what u doing)》之铭言:
: 像 c code 里 printf(" %6d ", a );
: ^^^^^^^
: 这种东西要怎麽用Java表现出来?
: 我有查到Sytem.out.format的东西,但是不会用
: 希望各位大大指导一下
<code>
int a=15;
System.out.printf(" %6d " ,a);
</code>
as simple as what you see,
Java also support
String.format(String fomat,Object... values);
API:
http://0rz.tw/b62sv
notice: since 1.5
--
I am a person, and I am always thinking .
Thinking in love , Thinking in life ,
Thinking in why , Thinking in worth.
I can't believe any of what ,
I am just thinking then thinking ,
but worst of all , most of mine is thinking not actioning...
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.134.27.68