| Author |
why does this work with %s
|
Ankur kothari
Ranch Hand
Joined: Sep 06, 2009
Posts: 531
|
|
why does this work with %s if i want to print only 123..is there any other way with &f?
|
 |
Siva Masilamani
Ranch Hand
Joined: Sep 19, 2008
Posts: 377
|
|
%b and %s can work with any type of argument.
If you want to print 123 use %.0f
|
SCJP 6,SCWCD 5,SCBCD 5
Failure is not an option.
|
 |
Ankur kothari
Ranch Hand
Joined: Sep 06, 2009
Posts: 531
|
|
|
got the answer.......%s formats an object by calling its toString() method..hence 123.456 is converted into string and printed out......
|
 |
 |
|
|
subject: why does this work with %s
|
|
|