R
raver
Hi,
I am having a go at learning java programming!
For one of my projects i made a Date class & DateProgram class, Now i have
got to add a public method called setDay()that takes in an int and returns
void.
The method should check the parameter to ensure that it is a valid day (1
through 31).
If it is, assign it to the member variable day.
If it's not, display a message using System.out.println() stating that the
given day is not valid.
public void setDay(26)
{
int day(day > 1 && day < 31);
return void;
System.out.println("the day is not valid! " + day);
}
}
Could some one tell me if this is even right! or give me little help!
Thank you,
Tony
I am having a go at learning java programming!
For one of my projects i made a Date class & DateProgram class, Now i have
got to add a public method called setDay()that takes in an int and returns
void.
The method should check the parameter to ensure that it is a valid day (1
through 31).
If it is, assign it to the member variable day.
If it's not, display a message using System.out.println() stating that the
given day is not valid.
public void setDay(26)
{
int day(day > 1 && day < 31);
return void;
System.out.println("the day is not valid! " + day);
}
}
Could some one tell me if this is even right! or give me little help!
Thank you,
Tony