为什么不能写成c.get(YEAR)而非要写成c.get(Calendar.YEAR)?
c不是Calendar的子类对象吗
import java.util.Calendar;
public class CalendarDemo {
public static void main(String[] args) {
Calendar c = Calendar.getInstance();
//为什么不能是int year = c.get(YEAR);
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH)+1;
int day = c.get(Calendar.DATE);
System.out.println(c.get(Calendar.DATE));
System.out.println(year+"."+month+"."+day);
}
}