I have a assignment for a class where we take in a date then see if the date given is valid. If it is we then add a day onto it. Where I am having trouble is after I check that the date is valid it is saved to
Date appointment = new Date();
appointment = new Date(month, day, year);
Date.advanceDate(appointment);
in a different file called Date.java
public static void advanceDate(Date aDate){
//here is where I need to read the date in aDate
}
After searching online through the Java api I haven't been able to find a way to add a day onto appointment or get the day, month, and year from appointment add a day to that and then save it as a new Date
what I have tried is doing after looking at http://docs.oracle.com/javase/8/docs/api/java/util/Date.html
aDate.getDay();
but eclipse tells me "the method getDate()is undefined for the type Data
aDate.toString();
this doesn't return the month date and year it returns its location in memery
every solution I've found online uses Calender
which seems to have replaced Date