Help creating a calendar in Java
Hey guys, first post here so greatly appreciate any help given!
Im learning java with this book and at the end of the chapter its given me a project to create a gregorian calendar and output some values.
The first task is to add 100 days to the current date and then output the date and weekday.
Code:
import java.util.GregorianCalendar;
import java.util.Calendar;
public class Calendarproject {
public static void main(String args[]){
//todays date
GregorianCalendar cal = new GregorianCalendar();
//My Bday
GregorianCalendar bday = new GregorianCalendar(1988, Calendar.NOVEMBER, 19);
int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
int weekday = cal.get(Calendar.DAY_OF_WEEK);
cal.add(Calendar.DAY_OF_MONTH, 100);
cal.add(Calendar.DAY_OF_WEEK, 100);
}
}
This is as far as I've got, Im not sure which get methods to use to display the month and day of the week!! its really stressing me out.
I know its probably something simple!