JAVA得到2011.2月有多少天

package org.dudu;

import java.util.Calendar;

public class GetTime {
	public static void main(String args[]){
		Calendar   cal   =   Calendar.getInstance();   
		  cal.set(Calendar.YEAR,2011);   
		  cal.set(Calendar.MONTH,1);//2月   
		  int   maxDate   =   cal.getActualMaximum(Calendar.DATE);
		  System.out.println(maxDate);
	}

}

你可能感兴趣的:(java)