title: Java Checking number months
body: <p>I think I figure out what question I am trying to ask I dont want get(Calendar.MONTH) I want the month not to be greater than the last caldendar month that is why i am doing month -1, i realize that if i use get(calendar.MONTH) it is getting month of november I just want to see check and make sure its not a greater then the december to us 12 to the computer 11. that is why every other month is invalid that is the question I am trying to get an answer for!?</p>
  
  <pre><code>public Date(String inString)  
  {
      int month;// is define by cutting up the inString like this
      int day; // same as month
      int getSlash;
  
      getSlash = inStr.indexOf('/');
      month = Integer.parseInt(inStr.substring(0,getSlash));
      day = Integer.parseInt(inStr.substring(getSlash + 1));
  
      inStr = String.format("%02d/%02d%n",month,day);// padformatting string
      inStr=  new SimpleDateFormat("MM/dd").format(new SimpleDateFormat("MM/dd").parse(inStr));// checking to see if a actualdate
  
      GregorianCalendar cal = new GregorianCalendar();
  
      // this is what I don't understand after reading
  
      if (month -1 &gt; cal.get(Calendar.MONTH ) // how do I get it to say int of the month if the user types in 12 it gets invalid
      {
          System.out.Println("Invalid Month -&gt; " + month");
      }
  
  }
  </code></pre>
  
  <p>when I do this all but month 11 is considered not vailid any one know why? I can not figure it out.</p>