• Post Reply Bookmark Topic Watch Topic
  • New Topic

Formatting Java  RSS feed

 
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: 12441
42
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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!