pass reference of array lists to a function

Posted by bhavna raghuvanshi on Stack Overflow See other posts from Stack Overflow or by bhavna raghuvanshi
Published on 2010-06-16T11:12:05Z Indexed on 2010/06/16 11:22 UTC
Read the original article Hit count: 140

Filed under:

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???

© Stack Overflow or respective owner

Related posts about java