This content has been marked as final. Show 2 replies
Yeh. Those are constants, they don't represent properties of a Calendar, they're used to access the properties of a Calendar. Try
The constant MONTH belongs to the class, Calendar, you use it to tell the instance of Calendar which property you're interested in
Calendar cal = Calendar.getInstance(); int month = cal.get(Calendar.MONTH);
the month is 7, andNot that it's relevant to your original question, but the numerical value of the month in a Calendar is not relevant. You don't care what that value is. Don't try to use those values directly.
However, when I use the Calendar.MONTH orCalendar.MONTH isn't the value of that Calendar's month. It's simply the constant that indicates that the month is the field you're interested in.
Calendar.InstanceOf().Month I get: 2