• Post Reply Bookmark Topic Watch Topic
  • New Topic

Command-line problems  RSS feed

 
Bob Qualls
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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.
 
paul wheaton
Trailboss
Posts: 22534
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm moving this thread to the Cattle Drive forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!