Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    public class Date
    {
    // instance variables
    private int day, month, year;

    /**
    * Constructor for objects of class Date
    */
    public Date(int dd, int mm, int yy)
    ...
  2. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    In the person copy, yes.

    That will copy all the stuff that's current but it won't change if you change the original.
  3. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Ahhhh...I see now.

    Use dob.getDay(), dob.getYear(), dob.getMonth() for the other ones.
  4. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    First of all, how are you initializing the Date object dateofbirth?

    use this.getName,

    or whatever.

    Like if you had soemthing that had a constructor

    String name, int value, char c;
  5. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    You don't have a constructor (String value, char value2, String value3) do you?

    Oh you might.

    Let's see the copy method.

    In fact, show all the code.
  6. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Oh, I think I might see why it won't just let you pass it as a parameter.

    You do need the day, month, and year as parameters for the Person parameters in order to initialize the dateofbirth...
  7. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    :-?:-?

    Does the date of birth have to be passed as a parameter?

    If not, you can just do this:

    // note, this is an example

    private Date dateOfBirth;
  8. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    public Date(Date other)
    {
    day = other.day;
    month = other.month;
    year = other.year;
    }
    You don't have a method name so it assumes that this thing is a...
  9. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Does your Date class have a getDateOfBirth() method?

    If so, it can call that to get Date of Birth.

    However, I'm not sure how to pass it as parameter to Person class, the Date object that is.
    ...
  10. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Data type?

    Make DOB an object of Date?

    Have a method getDateOfBirth and setDateOfBirth.

    I think that's what they want you to do.

    I don't get
  11. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    That's supposed to be the constructor for the Date class.
  12. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    static final int JANUARY= 0;
    static final int FEBRUARY = 1;
    static final int MARCH = 2;
    static final int APRIL = 3;
    static final int MAY = 4;
    static final int JUNE = 5;
    static final int JULY =...
  13. Replies
    27
    Views
    3,378

    Re: dateOfBirth problems

    Date is mostly deprecated. Calendar works better.

    However, wouldn't a String work best?

    October 9, 1920

    10/09/1920
Results 1 to 13 of 13