View Single Post
  #1 (permalink)  
Old 07-16-2007, 07:01 PM
paul paul is offline
Member
 
Join Date: Jul 2007
Posts: 26
paul is on a distinguished road
it's possible format data in java?
In java, I know it's possible to format words or numbers. An example would be
Code:
System.out.printf("%15s\n", word);
Which would format whatever the value of word in a space with size 15.

Somewhere I read it's possible to do the same if you are returning a value, but did not provide any examples of it. I tried:

Code:
return %15s\n,word;
ovbiusly I'm trying to return "word", can I format it while I return it?

That doesn't work, as I get illegal start of expression as an error.
Thanks
Reply With Quote
Sponsored Links