Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing


  • 3 years ago

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; } } }

  • This Question is Open
  1. eSpeX
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

  2. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy