title: Weeks in month June 2014
body: <p>Sorry for asking daft question but I cannot get correct number of weeks in June 2014 returned by Calendar:</p>
  
  <pre><code>public static void main(String[] args) {
      Calendar calendar = Calendar.getInstance();
      calendar.set(Calendar.DAY_OF_MONTH, 1);
      calendar.set(Calendar.MONTH, Calendar.JUNE);
      calendar.set(Calendar.YEAR, 2014);
      calendar.setFirstDayOfWeek(Calendar.MONDAY);
      System.out
          .println("first day of week: " + calendar.getFirstDayOfWeek());
      System.out.println("weeks in month: "
          + calendar.getActualMaximum(Calendar.WEEK_OF_MONTH));
      System.out.println("days in month: "
          + calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
  }
  </code></pre>
  
  <p>I am getting:</p>
  
  <pre><code>first day of week: 2
  weeks in month: 5
  days in month: 30
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kEJew.png" alt="enter image description here"></p>
  
  <p>Why number of weeks in June 2014 is not 6? I am using jdk1.8.0_05 on Mac OS X 10.9.3.</p>