This is a horribly complicated subject for me to explain, but I'll try.
If I understand you correctly, you want to pass the array and modify it and not have to return it. In Java, you can do this the same way as C++.
The references/pointers you pass in Java/C++ pass by value. They are numbers.
Just for sake of an example:
char *temp = new char[x];
foo( temp );
void foo( char *ptr )
{
ptr = new char[y];
} `temp` still points at "new char[x]". Why?
I'll just show you a simplified example with sample addresses. It would probably help if you kept track on paper.
temp is created at location 0x00
a new array is allocated starting at location 0x10
the value of the array's address (0x10) is stored in 0x00 (temp)
`ptr` is created at location 0x04
a new array is allocated starting at location 0x20
the value of the array's address (0x20) is stored in 0x04 (ptr)
The chart would look like this:
location value
0x00 0x10
0x04 0x20
0x10 the value of temp[0]
0x20 the value of ptr[0]
Put another way, it is like saying this:
int temp = 1;
int ptr = temp;
ptr = 100;
Temp won't change, just ptr. char * is just an int that holds a memory address. (on 32-bit machines)