I have a main method and two other public methods in my main class.
main makes an array of default constructors. (ie int [] mainArray = new int[100]Then a function call to fxnA passes the array (ie fxnA( mainArray )
In fxnA takes an array on integers (ie. fxnA( int arr[] )
fxnA passes the array to another fxn, fxnB (ie fxnB( arr )
. And fxn Bs parameters look like this: fxnB( int a[] ); From this B does some stuff. then returns it to A which returns it to main, full complete and specilized.
When I run the main class it returns an array of 0's (default ints) to main from fxnA but in fxnA I outputed the array and found its to be correct there, so I assume B and A are doing its job. Why did it do this?
I was thought arrays where passed by reference in java?
NOMAD




Then a function call to fxnA passes the array (ie fxnA( mainArray )
Reply With Quote