How to print the results of a return method without using static or any static methods in Java
<p>I am currently new to Java and need help. So i am suppose to create three methods to my sorting code without using "static". The three methods I am suppose to use are myRandom, to create an array of random numbers, mySort, to sort the array from highest to lowest, and printArray, to print the array. The problem is I do not know how to print the array after it has been sorted. Does the print method not work? This is my code so far:</p>

<pre><code>import java.util.Arrays;
import java.util.Random;

public class SortAnimate6
{ 
    public static void main(String args[])
    {
        int numbers[] = new int[10];

        System.out.println("The array original:");



        System.out.println("The array generated:");


    }

    public int [] myRandom (int[] numbers)
    {
       Random random = new Random();
       for(int i=0; i&lt;numbers.length; i++)
           numbers[i] = random.nextInt(20); 
       return numbers;
    }

    public  void printArray(int[] list)
    {
         for (int counter = 0; counter &lt; list.length; counter++)
             System.out.print(list[counter] + " ");
         System.out.println();
    }

    public int[] mySort (int[] numbers)
    {
        for(int i=0; i&lt;numbers.length; i++)
        {
            for(int j=0; j&lt;numbers.length; j++)
            {
                if(numbers[i] &lt; numbers[j])
                {
                    int temp = numbers[i];
                    numbers[i] = numbers[j];
                    numbers[j] = temp;
                }
            }
        }
        return numbers;
     }
}
</code></pre>
