Originally posted by Stephanie Ll:
Hi
How do I create an array of Employer.
You already know
Originally posted by Stephanie Ll:
Employer [] emp = new Employer[2]
emp[0] =new Employer("Tim");
System.out.println(emp[0]);
What is wrong with my codes?
Nothing is wrong with this code
You've created an array of Employers ("new") and assigned it to a variable that can contain such ("emp").
Then you've created an Employer object ("new") and assigned it to an element of the array.
That's all there is to it
Stuart