Sunday, 29 September 2013

how to take an arraylist of string type from one method to another method

how to take an arraylist of string type from one method to another method

I am a couple of semesters into learning java and I am looking to move an
arraylist from one method to another. I have look everywhere but could not
find exactly what I need. Thank you.
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)
{
}

No comments:

Post a Comment