title: printing an array in multiple lines
body: <p>I am taking a programming class, and things just aren't clicking for me. I have an assignment that asks to:</p>
  
  <blockquote>
    <p>Write a program to assign the integer values 1 through 25 to a 25
    element integer array.  Then, print the array as five separate lines
    each containing five elements separated by commas.  The last element
    on each line should be followed by a newline instead of a comma.  The
    output of your program should appear exactly as follows: </p>
  
  <pre><code>1,2,3,4,5
  
  6,7,8,9,10
  
  11,12,13,14,15
  
  16,17,18,19,20
  
  21,22,23,24,25
  </code></pre>
    
    <p>Hints: </p>
    
    <ul>
    <li>One way to determine every 5th element is to use the modules operator (%).  If you divide the subscript by 5 and the remainder is
    0, it is the 5th number.</li>
    <li>You can use System.out.print() to print a value without a newline following it. This will allow you to print multiple things on the same
    line.</li>
    </ul>
  </blockquote>
  
  <p>I have a little bit of code but I don't know where to go from here:</p>
  
  <pre><code>public class Program4
  
  {
  
       public static int[] array;
  
       public static void main(String[] args);
  
       {
  
            int[] numbers = new int [25]
  
            for(int i=0; i&lt;25; i++)
  
                  array[i] = i + 1;}
  
       public static void printArray()
  
       {
  
            for(int i=1; i&lt;=25; i++);
  
            {
  
                 System.out.print(array[i - 1]);
  
                 if (i % 5 == 0)
  
                      System.out.printIn();
  
             }
  
       }
  </code></pre>
  
  <p>I just have a mental block about programming-can anyone help point me to some helpful examples?</p>