我已经学习了几个学期的 Java,我希望将数组列表从一种方法移动到另一种方法。我到处找,但找不到我需要的东西。谢谢你。
public static void addEmployee(ArrayList<String> list)
{
int i; //declares i as integer
//increments i for the array
for(i = 0; i < list.size(); i++)
list.get(i); //adds employees to an arraylist
for(i = 0; i < list.size(); i++)
addEmployee(list.get(i)); //This does not work
}//end public static void addEmplyoee(Arraylist<String> list)
public static void searchId(ArrayList<String> list)
{
}