title: how to compare the object from two different array list?
body: <p>The program I am writing is an auction application and what I have done so far is that two constructors create two <code>ArrayList</code> which are a <em>painting</em> and a <em>bid</em> list. The <code>Painting</code> list includes the painting <em>ID</em> and its <em>name</em>. The <code>Bid</code> list, instead, includes the <em>painting</em> names and the bid amount for each one. </p>
  
  <p>What I actually need is to prompt a message after which the user has to introduce its <em>username</em>, showing the painting name and the highest bid for it at the moment. For example, the highest amount for the <em>Strawberries</em> painting is <em>1000000</em>. So far, I have managed to show the painting name but not the highest bid.</p>
  
  <p>I would really appreciate if you could help me getting and idea of where to start from this point. It has been two days and I still cannot figure out the solution to my problem. Below are some blocks of code:</p>
  
  <p><strong>ArrayList constructor for  <em>Painting</em></strong> </p>
  
  <pre><code>private ArrayList&lt;Painting&gt; Painting;        
      {
          Painting = new ArrayList&lt;Painting&gt;();
      }
  
      public void add(int id, String name,String artist,String minibidprice)
      {
          Painting.add (new Painting(id,name,artist,minibidprice));
      }
      public void listAll ()
      {
          for (Painting p : Painting)
          {
              System.out.println(p);
          }
      }
  </code></pre>
  
  <p><strong>ArrayList constructor for bid list</strong></p>
  
  <pre><code>    private ArrayList&lt;Bids&gt;Bids;
      {
          Bids = new ArrayList&lt;Bids&gt;();
      }
  
  
      public void add(int id, String bname,String pname,int value)
      {
          Bids.add (new Bids(id,bname,pname,value));
      }
       public void listAll2 ()
      {
          for (Bids b : Bids)
          {
              System.out.println(b);
          }
      }
  </code></pre>
  
  <p>Below are the elements for these <code>ArrayList</code> objects. The first ones are the paintings, and the next ones the bids.</p>
  
  <pre><code>Bidlists p = new Bidlists();
  p.add(1440,"Water-Lillies","Claude Monet","$10,000.00");
  p.add(1441,"Flowers in a Blue Vase ","Paul Cezanne","$20,000.00");
  p.add(1442,"The Anglers","Henri Rousseau ","$50,000.00");
  p.add(1443,"Wild Potato Dreaming","Emily Kngwarreye","$45,000.00");
  p.add(1446,"Argenteuil","Claude Monet ","$100,000.00");
  p.add(1447,"Luncheon on the Grass","Paul Cezanne","$50,000.00");
  p.add(1448,"Antonia","Amadeo Modigliani ","$30,000.00");
  p.add(1450,"The Young Apprentice","Amadeo Modigliani","$20,000.00");
  p.add(1451,"Woman with Mandolin","Henri Matisse","$15,000.00");
  p.add(1457,"Strawberries","Pierre-Auguste Renoir $","$30,000.00");
  p.add(1458,"Alhalker Suite","Emily Kngwarreye ","$40,000.00");
  
  Bid lists bid = new Bid lists();
  bid.add(1,"Bill Chivers","Wild Potato Dreaming",100000000);
  bid.add(2,"Ric Herbert","Strawberries",11000000);
  bid.add(2,"Simon","Strawberries",32500000);
  bid.add(4,"Bill Chivers","Luncheon on the Grass",90000000);
  bid.add(5,"Simon ","Wild Potato Dreaming",110000000);
  bid.add(6,"Bill Chivers ","Strawberries",25000000);
  </code></pre>