aspose file tools*
The moose likes Beginning Java and the fly likes Formatting Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formatting Java" Watch "Formatting Java" New topic
Author

Formatting Java

Shae Weathers
Greenhorn

Joined: Jun 26, 2010
Posts: 8
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Oct 02, 2003
Posts: 11475
    
  16

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();


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Shae Weathers
Greenhorn

Joined: Jun 26, 2010
Posts: 8
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

Joined: Sep 29, 2008
Posts: 12617

It would have been nice to follow up shortly after posting the question, then, so people wouldn't keep answering it!
 
Consider Paul's rocket mass heater.
 
subject: Formatting Java