title: Date class in an IF statement
body: <p>This is my code:</p>
  
  <pre><code>import java.util.*;
  import java.io.*;
  import type.lib.GlobalCredit;
  import type.lib.CreditCard;
  import java.text.SimpleDateFormat;
  
  public class eCheck08A
  {
      public static void main(String[] args)
      {
          PrintStream out = System.out;
          Scanner in = new Scanner(System.in);
  
          GlobalCredit credit1 = new GlobalCredit().getRandom();
  
          out.print("Enter report range in years ... ");
          int range = in.nextInt();
          out.println("Cards expiring before " + range + " year(s) from now: ");
  
          SimpleDateFormat sf = new SimpleDateFormat("dd/MM/yyyy");
  
          for (CreditCard cc : credit1)
          {
              out.print(cc.getNumber());
              out.println("\t" + sf.format(cc.getExpiryDate()));
          }   
      }
  }
  </code></pre>
  
  <p>At first, my app asks for Range years, lets say we enter "3". I want to put a " * " beside my date of any Year that is below the range number. Im assuming Java assumes that the date is as of today, so July 23, 2012. So for example, if we get 16/04/2013, I want a " * " beside it. But if we get 23/05/2016, no " * " to appear. </p>
  
  <p>Edited:</p>
  
  <pre><code>  Date endDate = new Date(2015, 12, 31);
      for (CreditCard cc : credit1)
      {
          if (cc.getExpiryDate().compareTo(endDate) &lt; 0)
          {
              if(cc.getExpiryDate().compareTo(endDate) &gt; 0)
              {
                  out.print("*");
              }
              out.print(cc.getNumber());
              out.println("\t" + sf.format(cc.getExpiryDate()));
                       }
              }
  </code></pre>
  
  <p>the range is the</p>