title: Passing an ArrayList from a method to another in the same class?
body: <p>I am coding a small project for a Clothes Shop.
  and in one of my classes 2 variables(<strong>item</strong> &amp; <strong>price</strong>) will be passed
  each time a user will select a
  certain product...</p>
  
  <p>they will be passed into 2 different methods..</p>
  
  <p>one with adding the <strong>item</strong> and one with adding a <strong>price</strong>.</p>
  
  <p>and I am trying to take the first array which has all the clothes that have been added to the cart and the other one with all the prices of each and every item</p>
  
  <p>every item and its price has similar <strong>indexes</strong> because they are being added at the same time...</p>
  
  <p>so now... my problem is that I do want to pass both of these <strong>ArrayLists</strong> into my method "<strong>PrintRecipt()</strong>" so I'll be able to print the items with their prices in-front of them...</p>
  
  <p>code:-</p>
  
  <pre><code>package clothesshop;
  import java.util.ArrayList;
  public class Cart {
  void cartAddi(String item){//adding a certain item will be passed here
      ArrayList&lt;String&gt; clothes = new ArrayList&lt;String&gt;(5);
      clothes.add(item); 
  }
  int cartAddp(int price){//along with its price to be added to the cart
      ArrayList&lt;Integer&gt; cost = new ArrayList&lt;Integer&gt;(5);
      cost.add(price); int TotalP=0;
      for (int total : cost) {
         TotalP = TotalP  + total; //total price
      }
      return TotalP;
  }
  void PrintRecipt(){ 
      //taking both ArrayLists and printing them here?
     }  
  }
  </code></pre>