title: date validation not working in case of wrong year input
body: <p>I am using the following code for validating date.the code is working fine for days and months but its accepting the more than 5 digit year value but in the format i have specified "yyyy".</p>
  
  <p><strong>Question:</strong> why it is returning <strong>true</strong> in case of 21114 because its not a valid date with respect to my specified format.?</p>
  
  <pre><code>import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  
  public class raju {
  
      public static void main(String[] args) {
          boolean a=raju.isThisDateValid("12/12/21114","MM/dd/yyyy");
          System.out.println(a);
      }
  
  
      public static boolean isThisDateValid(String dateToValidate, String dateFromat){
  
          if(dateToValidate == null){
              return false;
          }
  
          SimpleDateFormat sdf = new SimpleDateFormat(dateFromat);
          sdf.setLenient(false);
  
          try {
  
              //if not valid, it will throw ParseException
              Date date = sdf.parse(dateToValidate);
              System.out.println(date);
  
          } catch (ParseException e) {
  
              e.printStackTrace();
              return false;
          }
  
          return true;
      }
  
  }
  </code></pre>