public int resizeArr(int  b,int n)
z = n;
b = new int;
b = (int)ArrayUtils.expand(b);
Mark Nathon wrote:You can call a method by value or by reference.
So, any modification to the array elements in another function would mean that the original array would also be modified similarly.
I see Stephan has already explained your mistake. Thank you for giving us that link It is unfortunate that people still write that sort of rubbish in tutorials.
Mark Nathon wrote:. . . You can call a method by value or by reference. . . . Java always passes arrays and vectors by reference. . . .