title: Method not visible help?? Java
body: <p>I have an issue with a method not being visible to another class and I can't figure it out. 
  I have a Shopping_Basket class that has a Merchandise list (Merchandise is a class). I'm trying to have the Merchandise list in the Shopping_basket class to reach a getItemCost method in the Merchandise class. However i get an error that the method is not visible... I can't figure out what's wrong:</p>
  
  <pre><code>public class Shopping_Basket { 
     private List&lt;Merchandise&gt; basket;
     public List&lt;Merchandise&gt; getList() {
      return basket;
  }
  
     public Shopping_Basket() {
      basket = new ArrayList&lt;Merchandise&gt;();
     }
     public double getTotalCost() {
      double j = 0; 
      for (int i = 0; i &lt; this.getList().size(); i++){            
           j += basket.get(i).getItemCost();
      }
      return j;
  }
  </code></pre>
  
  <p>Here's the Merchandise Class:</p>
  
  <pre><code>public class Merchandise {
  private String item_name;
  
  private int item_cost;
  
  public Merchandise(String name, int cost) {
      this.item_name = name;
      this.item_cost = cost;
  }
  public String getItemName() {
      return item_name;
  }
  
  public double getItemCost() {
      return item_cost;
  }
  </code></pre>
  
  <p>So error in the getTotalCost() method and it says the getItemCost() is not visible... help?</p>