Here you can find the source of sumDayByYearMonth(int year, int month)
public static int sumDayByYearMonth(int year, int month)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { public static int sumDayByYearMonth(int year, int month) { Calendar c = Calendar.getInstance(); c.clear();//w w w . java2 s. co m c.set(1, year); c.set(2, month - 1); return c.getActualMaximum(5); } }