• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Command-line problems

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
public class Hundred
{
public static void main(String args[])
{
String x = args[0];
for(int i = 0; i <10; i++)
{
for(int y = 0; y <9; y++)
{
System.out.print(x + " ");
}
System.out.println(x);
}
}
}
This code diplays nicely to the console. However, if (x + " ") is too long the string breaks and the display becomes garbled. A solution is not what I'm begging for here. I would appreciate clues to the correct path to follow that will enable me to structure my own solution.
 
Trailboss
Posts: 23780
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm moving this thread to the Cattle Drive forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic