谢谢大家来帮忙,请大家帮忙做一下。谢谢

解决方案 »

  1.   

    public static int getWorkingDay(  int month) throws ParseException{

    Calendar  cal = Calendar.getInstance(); 

    cal.set(Calendar.MONTH, month-1);

            int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH);
            
            // 条件的最后一天
            String date = "2016年"+month+"月"+lastDay+"日";        SimpleDateFormat  sdf = new SimpleDateFormat("yyyy年MM月dd日");
         
          cal.setTime(sdf.parse(date));
            
            int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
            
            if(w == 6 ){
             return lastDay-1 ;
            }
            
            if( w== 7){
             return lastDay-2;
            }
            
    return  lastDay ; 

    }