Nesting Your for Loops with another for loop - Java Language Basics

Java examples for Language Basics:for

Description

Nesting Your for Loops with another for loop

Demo Code

public class NestedLoop
{
  public static void main(String[] args)
  {//from   w  ww  .  j a  v a 2s  .  co  m
    for(int x = 1; x < 10; x++)
    {
      for (int y = 1; y < 10; y++)
        System.out.print(x + "-" + y + "  ");
      System.out.println();
    }
  }
}

Related Tutorials