title: Asking for birthday as a user input without using java.util.Date method
body: <p>I am trying to make a program that will allow the user to input two sets of name and birthday and will compare whether the inputs are identical.</p>
  <p>I have a separate class named MyDate which contains the month, day and year, thus I created an object which I named &quot;dob&quot; in my person class, which contains the String name and MyDate dob . Upon creating a test program, I'm having difficulty on how to get the birthday input and set it as &quot;MM-dd-yyyy&quot; since I cannot use the java.util.Date method.</p>
  <p>This is what I have so far:</p>
  <pre><code>    System.out.println(&quot;Enter birthdate: &quot;);
      String bd=console.next();
      SimpleDateFormat sdf=new SimpleDateFormat(&quot;MM-dd-yyyy&quot;);
      MyDate dob = sdf.parse(bd);
      p1.setDob(dob);
  </code></pre>
  <p>Any idea on how to fix it? any help would be appreciated</p>
  <p>class MyDate for this program:</p>
  <pre><code>public class MyDate {
      private int day;
      private int month;
      private int year;
      
      public MyDate() {
      }
      
      public MyDate(int month, int day, int year) {
          setDay(month);
          setMonth(day);
          setYear(year);
      }
  
      public int getMonth() {
          return month;
      }
  
      public void setMonth(int month) {
          this.month = month;
      }
  
      public int getDay() {
          return day;
      }
  
      public void setDay(int day) {
          this.day = day;
      }
  
      public int getYear() {
          return year;
      }
  
      public void setYear(int year) {
          this.year = year;
      }
      
      public int hashCode() {
          return this.getMonth() ^ this.getDay() ^ this.getYear();
      }
      
      public String toString() {
          return this.month+&quot;-&quot;+this.day+&quot;-&quot;+this.year+&quot; &quot;;
      }
      
  }
  </code></pre>
  <p>The program's output should look similar to this:</p>
  <pre><code>    enter name: jay
      enter birthday: 02-07-1999
      enter name: jay
      enter birthday: 02-07-1999
      IDENTICAL
      name: jay
      birthday: 02-07-1999
      name: jay
      birthday: 02-07-1999
  
      
  </code></pre>