title: The method change(Bar, Bar) is undefined for the type ArrayList<Bar>
body: <p>I am trying to change the value of a 'Bar' object, I've created a change method that takes 2 bar variables, however when I try and use it on 'list.get(i)' within the compareBar method I get an error that says this method is undefined for the type ArrayList, is this not a Bar object and how do I change it inorder to be so?</p>
  
  <pre><code> public class Envelope {
      ArrayList&lt;Bar&gt; list = new ArrayList&lt;Bar&gt;();
  
  
      //Compares and adjusts range of bars accordingly    
      public void compareBars() {
          for(int i = 0; i &lt; list.size(); i++) {
              if(list.get(i+1).left &lt;= list.get(i).right) {
                  if(list.get(i).height &gt;= list.get(i+1).height) {
                      list.change(list.get(i+1),list.get(i));
                  }else if(list.get(i+1).height &gt;= list.get(i).height) {
                      list.change(list.get(i),list.get(i+1));
                  }
              }
          }
      }
      // Modifies ranges of bar values
      public void change(Bar target, Bar replacement) {
          if(target.left &lt; replacement.left) {
              target.right = replacement.left;            
          }
          if (target.left &gt; replacement.left) {
              target.left = replacement.right;
          }
      }
  
  }
  </code></pre>