title: How to extract a certain value from an Array list that has multiple values for element
body: <p>I have the following arraylist (below).  The first two values are for  Systolic and diastolic blood pressures.  I would like to ultimately code a method for obtaining the highest Systolic blood pressure for the ArrayList but I don't know how to isolate that particular value.  </p>
  
  <pre><code>public class Blood {
  
      private int systolic;
      private int diastolic;
  
      private Day day;
  
      public Blood(int systolic, int diastolic, Day day)
      {
          this.systolic = systolic;
          this.diastolic = diastolic;
          this.day = day;
      }
  
      //setters and getter variables in this class
      public void setSystolic(int systolic)
      {
          this.systolic = systolic;
      }
  
      public int getSystolic()
      {
          return systolic;
      }
  
      //Method for determining the highest Systolic blood pressure
      public String toString()
      {
          return String.format("%s%10s%20s",systolic,diastolic,day.toString());
      }
  }
  
  public class Day {
      private int num1;
      private int num2;
      private int num3;
  
      public Day(int num1, int num2, int num3)
      {
          this.num1 = num1;
          this.num2= num2;
          this.num3 = num3;
      }
  
      public String toString()
      {
          return String.format("%d%s%d%s%d",num1,"/", num2, "/", num3);
      }
  
          public static void main(String[] args)
          {
      Day cr = new Day(9,11,2013);
      System.out.println(cr.toString());
      }
  }
  
  public static void main(String[] args) 
  {
      //Create and populate ArrayList
      ArrayList&lt;Blood&gt; mary = new ArrayList&lt;Blood&gt;();
      mary.add(new Blood(94,61, new Day(2,5,2013)));
      mary.add(new Blood(97,65, new Day(3,5,2013)));
      mary.add(new Blood(144,99, new Day(4,5,2013)));
      mary.add(new Blood(123,88, new Day(5,5,2013)));
      mary.add(new Blood(177,110, new Day(6,5,2013)));
      mary.add(new Blood(145,89, new Day(7,5,2013)));
  
      System.out.printf("%s%10s%10s\n", "Systolic", "Diastolic", "Date");
      for (int i = 0; i&lt;mary.size(); i++)
          System.out.println(mary.get(i));
  }
  </code></pre>