Java - How to join multiple values in a multidimensional array?
<p>I'm beginner programmer, I have fallen into a rabbit hole trying to understand how to use arrays. I'm trying to create a table using multidimensional arrays and I am looking to create a table with 7 rows and 5 columns. </p>

<ul>
<li>column 1 = will take values from the user input.This input is stored in an array.  </li>
<li>column 2 = will print the highest input in that array.</li>
<li>column 3 = will print the lowest input in that array</li>
<li>column 4 = will print take the increment Total. i.e current input + previous input. </li>
<li>column 5 = will take the increment average. i.e Total/Index</li>
</ul>

<h2>Complete Code below</h2>

<pre><code>import java.util.Scanner; 

public class Numbers {
    public static void main(String[] args)
    {
     //----User Input - Add values to array ----//

    Scanner keyboard = new Scanner(System.in); 

    int places = 7; 
    int [] values = new int [places];
    int sum = 0; 

    System.out.println("Enter a Numbers:");

        for (int count = 0; count &lt; places; count++)
            {       
            values[count] = keyboard.nextInt();
            System.out.println(values[count]);
            }

     //----------------Total---------------------//

        for (int numb : values)
            {
            sum = sum + numb;
            }

        System.out.println("\n Total:" +  sum);

   //----------Average------------------------/

        double avg = 0; 
        if (values.length &gt; 0)
            {
            avg = sum / values.length;
            }

        System.out.printf("\n Average:"+ avg);


   //---------Table Start---------------------//


        int [] [] table = new int [7][5];

        for (int row =0; row &lt; 7; row++)
            for (int column = 0; column &lt; 5; column++)
            table [row][column] = getTable(column, column, column, column, avg);


        System.out.println("\n\nIndex\tInput\tHigest\tLowest\tTotal\tAverage"); 

        for (int row = 0; row &lt; 7; row++)
            {
            System.out.print((row + 1) +  " "); 
            for (int column = 0; column &lt; 5; column++)
                System.out.print("\t  " + table[row][column] + " "); 
            System.out.println(); 
            }

        }

public static int getTable(int input, int highest, int lowest, int total, double average) {

/* TO DO: 
     * - add each user input from values array into Input column
     * 
     * - add highest/lowest values in the Highest/Lowest column
     * 
     * - add each of the array element total in Total column - this column should take previous Total plus current total. 
     *          i.e Total = Total + Input
     * 
     * - add Average - Current average value. 
     */

    return 0;

    }
}
</code></pre>

<p>What I don't know is how to get my code to fill each of the rows using different values each time. </p>

<p><strong>For Example:</strong> </p>

<p>Index 1 </p>

<ul>
<li>1st column take first value of the values array</li>
<li>2nd column: take highest value of the values array</li>
<li>3rd column: take lowest value of the values array</li>
<li>4th column: take previous element of values array plus the current value</li>
<li>5th column: take total/index</li>
</ul>

<p>I know that may need to create a method to get my program to loop through but I just don't know how to do it. I've tried a few different ways, but I'm just getting confused. In the left corner of the screenshot below, is how the columns would look like. Notice how they are all returning 0, which I known that is coming from the getTable method that I created, which is doing just that. </p>

<p><a href="https://i.stack.imgur.com/jbaBY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jbaBY.png" alt="enter image description here"></a></p>