How to create an object of one class with arguments of another? Java
<p>I'm creating a user defined classed named "Employee" and it will hold basic data about employees. Such as name, birthday and hire date.</p>

<p>In my previous program I created a user defined class named "Date" this held 3 int values (month, day, year).</p>

<p>Birthday and hire date of the Employee class must be of Date type.</p>

<p>Here is my constructor for my Date class 
 //day, month, year were initialized before </p>

<pre><code> public Date(int m, int d, int y){
     day = d;
     month = m;
     year = y;
 }
</code></pre>

<p>And an example of instantiating a Date object</p>

<pre><code>Date date1 = new Date(1, 1, 1582);
</code></pre>

<p>Here is my constructor for my Employee class</p>

<pre><code> public Employee(String fName, String lName, Date d1, Date d2) {
   firstName = fName;
   lastName = lName;
   date1 = d1;
   date2 = d2; 
 }
</code></pre>

<p>When trying to create an object of the Employee class(in another class, this class is named "Employee Test") I get an erorr </p>

<blockquote>
  <p>"required:String, String, Date,Date</p>
  
  <p>found: String, String, int, int, int, int, int, int".</p>
</blockquote>

<pre><code> Employee e = new Employee("Tom" , "Doe",1 , 5 , 1995, 1 , 6 , 2011 );
</code></pre>

<p>The issue appears to be that the object is receiving the data as int values rather than type Date, even though the Date objects require 3 int values itself. </p>

<p>I'm confused on how to create this object, is my constructor wrong? Do I need to pass actual instantiated objects as arguments while creating an Employee Object?</p>

<p>Thanks</p>