pass reference of array lists to a function
- by bhavna raghuvanshi
I need to pass two array list references to a function and return the reference of merged array list.
how can i do it????
pls help....
public int merge(ArrayList x, ArrayList y)
{
List all = new ArrayList();
all.addAll(x);
all.addAll(y);
System.out.println(all);
return all;
}
is it correct???