jQuery in Action, 2nd edition*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 10905
    
  12

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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formatting Java
 
Similar Threads
header color and the cursor double headed arrow in JTable is not visible
yet another jLabel
Jtable retreiving data
Need ScrollPane with just VERTICAL Scrolling facility
JPanel inside JSPlitPane -autoresie