title: Passing an array value from one class to another
body: <p>I want all my array data from this class to be passed to another class and I don't know how to do it.
  Here is my code:</p>
  <pre class="lang-java prettyprint-override"><code>public static void main(String[] args) {
      String menu[] = {&quot;&quot;, &quot;Hotsilog&quot;, &quot;Porksilog&quot;,
              &quot;Bangsilog&quot;, &quot;Tapsilog&quot;, &quot;Chicksilog&quot;};
      double priceList[] = {0, 20.00, 20.00, 20.00, 20.00, 20.00};
      int quantOrder[] = new int[100];
      int foodChoice[] = new int[100];
      int qntty = 0;
  
      Scanner scan = new Scanner(System.in);
      System.out.printf(&quot;      %3s%14s\n&quot;, &quot;Menu&quot;, &quot;Price&quot;);
      for (int i = 1; i &lt;= 5; i++) {
          System.out.printf(&quot;[%d] %-15s%.2f\n&quot;, i, menu[i], priceList[i]);
      }
      System.out.print(&quot;How many items do you want to order? &quot;);
      qntty = scan.nextInt();
      for (int i = 1; i &lt;= qntty; i++) {
          System.out.println(&quot;Enter the number of your choice: &quot;);
          foodChoice[i] = scan.nextInt();
          System.out.println(&quot;You choose &quot; + menu[foodChoice[i]] + &quot;!&quot;);
          System.out.print(&quot;Quantity of order :&quot;);
          quantOrder[i] = scan.nextInt();
      }
  }
  </code></pre>
  <p>And I want all the datas from up there to be passed to this class and compute all the prices</p>
  <pre class="lang-java prettyprint-override"><code>public class methOds {
      double Price[] = new double[100];
      double totalPrice = 0;
  
      methOds() {
          Price[i] = priceList[foodChoice[i]] * quantOrder[i];
          totalPrice = totalPrice + Price[i];
      }
  }
  </code></pre>
  <p>Can some explain me how to work with it?</p>
  <p>Thanks in advance!</p>