Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formatting Java

 
Shae Weathers
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help formatting an assignment. The instructions were to create a program that would write a name 100 times. The program outputs the information vertically, but I need it to output it horizontally. Can anyone help me with this matter?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure--what do you have so far? Have you checked the Javadocs for the various print methods? (Hint: some print a new line after the string you pass in, some don't.)

And welcome to JavaRanch!
 
fred rosenberger
lowercase baba
Bartender
Posts: 12127
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you be more specific? I'm not sure I understand what you mean by 'horizontally' vs 'vertically'.

My guess is you should look at the difference between

System.out.print();

and

System.out.println();
 
Shae Weathers
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies, shortly after I posted the question I realized it was a matter of removing "ln" from the system.out.print statement.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would have been nice to follow up shortly after posting the question, then, so people wouldn't keep answering it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic