How to organize and print the values of an array in java?
<p>I hava created a program with a for-loop that determines the number of arrays created. I had to organize each arrey in ascending order, so I created another class that do this (<strong>Organizer</strong>), <strong>but I dont know how to export each array (array code in the main class)</strong></p>

<p>Once I orginised the arreys I need to calculate and print the results of the arrays values.</p>

<p>Here is an example of what the output have to looks like.</p>

<p>if the arrey value is the same the total value adds 10</p>

<p>if the arrey value is a squence the total value adds 20</p>

<blockquote>
  <p>Input rounds: 4</p>
  
  <p>Round 1 --> 1 3 7 total value: 11</p>
  
  <p>Round 2 --> 1 4 5 total value: 10</p>
  
  <p>Round 3 --> 1 1 1 total value: 13</p>
  
  <p>Round 4 --> 1 2 3 total value: 26</p>
</blockquote>

<p><strong>PS I am new at java.I think I am close to the solution but I can't figure out how to overcome this problem</strong></p>

<p><strong>Organizer Class</strong></p>

<pre><code>public class Organizer {
     // ---------------------- ATTRIBUTES ---------------------
     protected int rand1;
     protected int rand2;
     protected int rand3;

     // ------------------ CONSTRUCTOR -------------------
     public Organizer(int o1, int o2, int o3) {
          // This puts the three values from arrey in ascending order.
          int tmp;
          if (o2 &lt; o1) {
              tmp = o2;
              o2 = o1;
              o1 = tmp;
          }
          if (o3 &lt; o2) {
              tmp = o3;
              o3 = o2;
              o2 = tmp;
          }
          if (o2 &lt; o1) {
              tmp = o2;
              o2 = o1;
              o1 = tmp;
          }
          rand1 = o1;
          rand2 = o2;
          rand3 = o3;
     }

     // --------------------- METHODS ---------------------
     // Accessor methods
     public int getRand1() {
          return rand1;
     }

     public int getRand2() {
          return rand2;
     }

     public int getRand3() {
          return rand3;
     }

     // Will return true if all values are the same. 
     // This depends on the values being ordered.
     public boolean threeSame() {
          return (rand1 == rand3);
     }

     // Will return true if we have a run e.g. "one, two, three", or "four, five, six".
     // Again, this depends upon the values being ordered.  
     public boolean sequence() {
          return (( (rand1 + 1) == rand2) &amp;&amp; ( (rand2 + 1) == rand3));
     }


     public void printResult() {
          if (threeSame())
              System.out.println("The values are all the same.");
          else if (sequence())
              System.out.println("The values are a sequence.");

    }

}
</code></pre>

<p><strong>Calculator Class</strong></p>

<pre><code>public class Calculator extends Organizer {

public static int totalValue;

   public void calcSumOfValues(int s1, int s2, int s3) {
     int sumOfArrey;
   sumOfArrey= s1 + s2 + s3;
   }
    public void calcSumOfExtraValues(int sumOfArrey) {
            if (threeSame())
              totalValue= sumOfArrey + 10;
            else if (sequence())
              totalValue= sumOfArrey + 20;
            else
              totalValue= sumOfArrey
   }
        public void printResult() {
          System.out.println("round " + (r+1) + "--&gt; " + randomArray [i] + "Total value" + totalValue  );
        }
   }
</code></pre>

<p><strong>Main Class</strong></p>

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

public class UserClass {

  // ------------------- FIELDS ------------------------    
        // Create instance of Scanner class
        public static Scanner input = new Scanner(System.in);
        // variables
        public static Organizer orga;
        public static Calculator calc;

        public static int randomArray [];

    // ------------------ METHODS ------------------------  
        public static void main(String[] args) {

        int rounds; // input by user

        System.out.print("Please input number of rounds (grater or equal than 0) --&gt; ");
        rounds = input.nextInt();
        System.out.print("\n");

        for (int r = 0; r &lt; rounds; r++) {  // loop for number of rounds
        int randomArray [] = new int [3];
        for (int i = 0; i &lt; randomArray.length; i++) { // loop for random Array 
        randomArray [i] = (int)(Math.random()*8);   
        }               
        }

        // Create new organizer and calculator instances
        orga = new Organizer(randomArray [0], randomArray [1], randomArray [2]);
        calc = new Calculator();

        //Calculate
        calc.getRand1();
        calc.getRand2();
        calc.getRand3();
        calc.threeSame();
        calc.sequence();
        calc.calcSumOfValues();     
        calc.calcSumOfExtraValues();

    }//end Main Method  
}// end Class
</code></pre>