'How to make an object that has a another object as a parameter in JAVA
So I have 2 constructors
one for the object MyDate:
public MyDate(int month, int day, int year) {
this.month = month;
this.day = day;
this.year = year;
and one for the object Person:
public Person(String name, MyDate dob) {
this.name = name;
this.dob = dob;
so how do I make a new Person object in my main method?
Person p1 = new Person(?????);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
