How do I replace the following array with an ArrayList.
Employee[] companyTeam = {manager, engineer1, superviso1, accountant, intern };
You can do something like
List<Employee> companyTeam = Arrays.asList(manager, engineer1, superviso1, accountant, intern);
import java.util.List; and import java.util.Arrays; to the top of your file. Or if you're using Eclipse ctrl + shift + O will import them for you.ArrayList<Employee> companyTeam = new ArrayList<Employee>(Arrays.asList(manager, engineer1, superviso1, accountant, intern));
java.util.ArrayListcheck the duplicate question (above). FYI,Arrays.asListreally returns anArrays.ArrayList, although that might not matter.