Ask your own question, for FREE!
Computer Science 6 Online
OpenStudy (anonymous):

hey guys, i need help with this code because i don't know the parameter and can't figure it out: public class Date { private int month; private int day; public Date (int month, int day) { //Constructs a new Date representing the given month and day. setDate(month, day); } public boolean equals(Date d) { //This method should return true when the Date object on which //it was called represents the same date as the given Date parameter, //or false otherwise. if ( ) { return true; } else { return false; } } }

OpenStudy (espex):

You are creating "Dates" and setting the month and day inside each. So if you run the equals() command, it should read and compare its values to that of 'd' and return true if they are the same date.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!