title: Checking if input String date is in the future in java using parse, using "throws ParseException" when calling a method
body: <p>I am working on a credit card validation portion of a Class but I am stuck at how to approach checking if the card has expired or not.</p>
  
  <p>Payment Class(portion):</p>
  
  <pre><code>public Payment(...,String date,...)
  {
      ...
      sendEmail(order,this.billingAddress,remark);
  }
  
  public boolean checkExpiry(String inDate) throws ParseException
  {
      SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy");
      Date expiry=format.parse(inDate);
      Date today = new Date();
      if(today.before(expiry))
      {
          return true;
      }else{
          return false;
      }
  }
  
  public boolean isValid(String cardType,String cardNum,String date) throws ParseException
  {
      if(cardType.equals("MasterCard") || cardType.equals("Visa")){
          if(cardNum.length()==16){
             if(checkExpiry(date)){
                  return true;
              }else{
                  remark="Credit Card Expired";
                  return false;
              }
          }else{
              remark="Invalid Credit Card Number";
              return false;
          }
      }else{
          remark="Invalid Credit Card Type";
          return false;
      }
  }
  
  public void sendEmail(Order order, Address address, String remark)throws ParseException
  {
      Email email = new Email(customer);
      if(this.isValid(cardType,cardNum,date)==true){
          email.success(order,address);
      }else{
          email.failure(this.getRemark());
      }
  }
  </code></pre>
  
  <p>This is the method I am currently using. However, when making the method call in the constructor for the sendEmail() method, an error message tells me "unreported exception java.text.ParseException;must be caught or declared to be thrown".</p>
  
  <p>I have 2 questions:</p>
  
  <p>1)What should I do to make the class compile</p>
  
  <p>2)Is there a simpler/more efficient way to check if the input string containing date is in the future?</p>