int year,month;
try
{
year=Integer.parseInt(args[0]);
month=Integer.parseInt(args[1]+1);
}
catch (Exception e)
{
year=2004;
month=8;
}
得到year和month的值
Calendar calendar=Calendar.getInstance();
calendar.set(year,month,1);