I currently have a method called tomorrow() which modifies an objects attributes which in this case are day, month, year (This ins't java.util.Date, I've made my own Date constructor.)
So if for example I had an object called date1(30,12,2013) and I ran date1.tomorrow() it would make date1 = (1,1,2014) NOTE: We are currently assuming all months have 30 days.
Now this works fine if I keep it as public void tomorrow() and simply write
date1.showDate(); // show original value
date1.tomorrow(); // add 1 to day, do some if statements if day > 30, etc, etc
date1.showDate(); // show modified value
BUT I want tomorrow() to also have the function to print the modified date as a String, obviously I need to make my method public String tomorrow() and have a return section but I'm not entirely sure what I'm returning, I've tried returning showDate but it isn't working correctly.
Any help would be greatly appreciated.
NOTE: This is what I currently have for my tomorrow() method
public void tomorrow()
{
this.day++;
if(this.day > 30)
{
this.day = 1;
this.month++;
}
if(this.month > 12)
{
this.month = 1;
this.year++;
}
}